presto-main/src/main/java/io/prestosql/util/MoreLists.java/MoreLists/nElements
class MoreLists:    public static <T> List<T> nElements(int n, IntFunction<T> function)
    {
        checkArgument(n >= 0, "n must be greater than or equal to zero");
        requireNonNull(function, "function is null");
        return IntStream.range(0, n)
                .mapToObj(function)
                .collect(toImmutableList());
    }