Streamfilter(Predicate super T> predicate); Stream map(Function super T, ? extends R> mapper); T reduce(T identity, BinaryOperator accumulator); R collect(Collector super T, A, R> collector);
public interface Function{ R apply(T t); }
public interface BiFunction{ R apply(T t, U u); }
public interface BinaryOperatorextends BiFunction { }
public interface Supplier{ T get(); }
public interface Consumer{ void accept(T t); }
public interface BiConsumer{ void accept(T t, U u); }
public interface Predicate{ boolean test(T t); }
public interface BiPredicate{ boolean test(T t, U u); }
static class CollectorImplimplements Collector { private final Supplier supplier; private final BiConsumer accumulator; private final BinaryOperator combiner; private final Function finisher; private final Set characteristics; CollectorImpl(Supplier supplier, BiConsumer accumulator, BinaryOperator combiner, Function finisher, Set characteristics) { this.supplier = supplier; this.accumulator = accumulator; this.combiner = combiner; this.finisher = finisher; this.characteristics = characteristics; } CollectorImpl(Supplier supplier, BiConsumer accumulator, BinaryOperator combiner, Set characteristics) { this(supplier, accumulator, combiner, castingIdentity(), characteristics); } @Override public BiConsumer accumulator() { return accumulator; } @Override public Supplier supplier() { return supplier; } @Override public BinaryOperator combiner() { return combiner; } @Override public Function finisher() { return finisher; } @Override public Set characteristics() { return characteristics; } }