public ListType first(int n) {
        n = Math.min(n, items.size());
        return constructor.apply(items.subList(negate ? n : 0, negate ? items.size() : n), false);
    }
Returns the first n items in this list, or everything except those if negated.
vespajlib/src/main/java/com/yahoo/collections/AbstractFilteringList.java