static L virtualCountList(int n) { ret new RandomAccessAbstractList() { public int size() { ret n; } public Int get(int i) { ret i; } }; } // to is exclusive static L virtualCountList(int from, int to) { int n = max(to-from, 0); ret new RandomAccessAbstractList() { public int size() { ret n; } public Int get(int i) { ret from+i; } }; }