import com.github.andrewoma.dexx.collection.HashSet; import com.github.andrewoma.dexx.collection.Set; public class Main { public static void main(String[] args) { Set<Integer> numbers = HashSet.of(1, 2, 3, 4, 5); Set<Integer> evenNumbers = numbers.filter(number -> number % 2 == 0); } } import com.github.andrewoma.dexx.collection.IndexedList; import com.github.andrewoma.dexx.collection.List; public class Main { public static void main(String[] args) { List<String> fruits = IndexedList.of("apple", "banana", "orange"); List<String> updatedFruits = fruits.append("mango").remove("apple"); } } import com.github.andrewoma.dexx.collection.TreeSet; import com.github.andrewoma.dexx.collection.SortedSet; public class Main { public static void main(String[] args) { SortedSet<Integer> numbers = TreeSet.of(5, 3, 1, 4, 2); numbers = numbers.add(6).add(0); } }


上一篇:
下一篇:
切换中文