use of java8.util.function.IntUnaryOperator in project streamsupport by stefan-zobel.
the class IntPrimitiveOpsTests method testMap.
public void testMap() {
long sum = IntStreams.range(1, 10).filter(new IntPredicate() {
@Override
public boolean test(int i) {
return i % 2 == 0;
}
}).map(new IntUnaryOperator() {
@Override
public int applyAsInt(int i) {
return i * 2;
}
}).sum();
assertEquals(sum, 40);
}
Aggregations