DoubleSummaryStatistics () { Random r = new Random(); DoubleSummaryStatistics stat = new DoubleSummaryStatistics(); for (int x = 0; x < 10; x++) { double v = x; for (long count = (long) v; count > 0; count--) { double v1 = r.nextDouble() * v; stat.accept(v1); } } return stat; }