Java Stream
18 functions
streamcollection.stream()Returns a sequential Stream with this collection as its source.
filterstream.filter(predicate)Returns a stream consisting of elements that match the predicate.
mapstream.map(mapper)Returns a stream by applying the given function to each element.
flatMapstream.flatMap(mapper)Returns a stream by replacing each element with the contents of a mapped stream.
collectstream.collect(collector)Performs a mutable reduction using a Collector.
forEachstream.forEach(consumer)Performs the given action for each entry.
reducestream.reduce(identity, accumulator)Performs a reduction on the elements using an associative accumulator.
sortedstream.sorted(comparator?)Returns a stream with elements sorted.
distinctstream.distinct()Returns a stream with duplicate elements removed.
limitstream.limit(maxSize)Returns a stream truncated to be no longer than maxSize.
skipstream.skip(n)Returns a stream that discards the first n elements.
countstream.count()Returns the count of elements in the stream.
anyMatchstream.anyMatch(predicate)Returns whether any elements match the provided predicate.
allMatchstream.allMatch(predicate)Returns whether all elements match the provided predicate.
findFirststream.findFirst()Returns an Optional describing the first element.
Collectors.toListCollectors.toList()Returns a Collector that accumulates elements into a List.
Collectors.joiningCollectors.joining(delimiter, prefix?, suffix?)Returns a Collector that concatenates elements into a String.
Collectors.groupingByCollectors.groupingBy(classifier)Returns a Collector that groups elements by a classifier.
