@@ -0,0 +1,986 @@
+package org.g_node.nix.internal;%0A%0Aimport java.util.*;%0Aimport java.util.function.Predicate;%0A%0A/**%0A * Creates a list from a counter and a getter.%0A */%0Apublic final class ListBuilder %7B%0A%0A    public static %3CT%3E List%3CT%3E build(Counter counter, Getter%3CT%3E getter) %7B%0A        long c = counter.count();%0A        List%3CT%3E result = new LinkedList%3C%3E();%0A        for (long i = 0; i %3C c; i++) %7B%0A            result.add(getter.get(i));%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static %3CT%3E List%3CT%3E build(Counter counter, Getter%3CT%3E getter, Predicate%3CT%3E filter) %7B%0A        long c = counter.count();%0A        List%3CT%3E result = new LinkedList%3C%3E();%0A        for (long i = 0; i %3C c; i++) %7B%0A            T elem = getter.get(i);%0A            if (filter.test(elem))%0A                result.add(elem);%0A        %7D%0A        return result;%0A    %7D%0A%0A    @FunctionalInterface%0A    public interface Counter %7B%0A        long count();%0A    %7D%0A%0A    @FunctionalInterface%0A    public interface Getter%3CT%3E %7B%0A        T get(long index);%0A    %7D%0A%7D%0A

create lists from counter and getter