use of java.util.DoubleSummaryStatistics in project hazelcast-jet by hazelcast.
the class CollectorsTest method list_summarizingDouble.
@Test
public void list_summarizingDouble() {
DoubleSummaryStatistics summary = streamList().collect(DistributedCollectors.summarizingDouble(m -> (double) m));
assertEquals(COUNT, summary.getCount());
assertEquals(COUNT - 1, summary.getMax(), 0d);
assertEquals(0, summary.getMin(), 0d);
assertEquals(COUNT * (COUNT - 1) / 2d, summary.getSum(), 0d);
assertEquals((COUNT - 1) / 2d, summary.getAverage(), 0d);
}
use of java.util.DoubleSummaryStatistics in project hazelcast-jet by hazelcast.
the class DoubleStreamTest method summaryStatistics.
@Test
public void summaryStatistics() {
DoubleSummaryStatistics longSummaryStatistics = stream.summaryStatistics();
assertEquals(COUNT, longSummaryStatistics.getCount());
assertEquals(COUNT - 1, longSummaryStatistics.getMax(), 0D);
assertEquals(0, longSummaryStatistics.getMin(), 0D);
assertEquals(COUNT * (COUNT - 1) / 2, longSummaryStatistics.getSum(), 0D);
assertEquals((COUNT - 1) / 2D, longSummaryStatistics.getAverage(), 0D);
}
use of java.util.DoubleSummaryStatistics in project keycloak by keycloak.
the class ClosingDoubleStream method summaryStatistics.
@Override
public DoubleSummaryStatistics summaryStatistics() {
DoubleSummaryStatistics result = delegate.summaryStatistics();
close();
return result;
}
Aggregations