import org.eclipse.collections.api.list.MutableList;
import org.eclipse.collections.impl.factory.Lists;
public class Example1 {
public static void main(String[] args) {
MutableList<String> list = Lists.mutable.empty();
list.add("Hello");
list.add("World");
list.add("!");
list.each(System.out::println);
}
}
import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.impl.factory.Lists;
public class Example2 {
public static void main(String[] args) {
ImmutableList<Integer> numbers = Lists.immutable.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
int sum = numbers.select(n -> n % 2 == 0).sumOfInt(Integer::intValue);
System.out.println("Sum of even numbers: " + sum);
}
}