blob: 06dd23ffc3e61bc29d52d1710b07890c0fa9ff89 [file]
package misc;
import one.util.streamex.StreamEx;
public class Chain {
public static void main(String[] args) {
// Breakpoint!
final long count = StreamEx.of(1, 2, 3, 4).chain(x -> dividable(x, 3)).count();
System.out.println(count);
}
private static StreamEx<Integer> dividable(StreamEx<Integer> stream, int num) {
return stream.filter(x -> x % num == 0);
}
}