class StreamApi {

    public static Integer getInfiniteStreamLastElementUsingReduce() {
        Stream<Integer> stream = Stream.iterate(0, i -> i + 1);
        return stream.limit(20).reduce((first, second) -> second).orElse(null);
    }

}