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