public static <T> Collector<T, ?, Seq<T>> taking(long n) {
        return Collector.of(
            () -> new ArrayList<T>(),
            (l, v) -> {
                if (l.size() < n)
                    l.add(v);
            },
            (l1, l2) -> {
                l1.addAll(l2);
                return l1;
            },
            Seq::seq
        );
    }
Get a {@link Collector} that takes the first <code>n</code> elements
from a collection.
jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java