Iterate two Java-8-Streams together [duplicate]
问题 This question already has answers here : Zipping streams using JDK8 with lambda (java.util.stream.Streams.zip) (14 answers) Closed 5 years ago . I'd like to iterate two Java-8-Streams together, so that I have in each iteration-step two arguments. Something like that, where somefunction produces something like Stream<Pair<A,B>> . Stream<A> as; Stream<B> bs; somefunction (as, bs) .forEach ((a, b) -> foo (a, b)); // or something like somefunction (as, bs) .forEach ((Pair<A, B> abs) -> foo (abs