sdk install jbang
touch list.jsh jbang --interactive --deps org.eclipse.collections:eclipse-collections-api:10.4.0 --deps org.eclipse.collections:eclipse-collections:10.4.0 list.jsh
//DEPS org.eclipse.collections:eclipse-collections-api:10.4.0 | |
//DEPS org.eclipse.collections:eclipse-collections:10.4.0 | |
import org.eclipse.collections.impl.factory.*; | |
var list = Lists.immutable.of(1,2,3,4,5,6,7,8,9).collect(i -> i*i); | |
// [1, 4, 9, 16, 25, 36, 49, 64, 81] | |
list.get(0) // 1 | |
list.getFirst() // 1 | |
list.getLast() // 81 | |
list.min() // 1 | |
list.max() // 81 | |
list.sumOfInt(i -> i) // 285 | |
//list.sortThis() | |
list.subList(1,3) // [4,9] | |
list.asReversed() | |
list.makeString("-") // 1-4-9-... |