use of com.annimon.stream.function.LongToDoubleFunction in project Lightweight-Stream-API by aNNiMON.
the class MapToDoubleTest method testMapToDouble.
@Test
@SuppressWarnings("unchecked")
public void testMapToDouble() {
DoubleStream stream = LongStream.rangeClosed(2, 4).mapToDouble(new LongToDoubleFunction() {
@Override
public double applyAsDouble(long value) {
return value / 10d;
}
});
assertThat(stream, DoubleStreamMatcher.elements(array(closeTo(0.2, 0.00001), closeTo(0.3, 0.00001), closeTo(0.4, 0.00001))));
}
Aggregations