IntSummaryStatistics () { IntSummaryStatistics stat = new IntSummaryStatistics(); long limit = 20; for (String x = ""; ; x = x + "a") { if (limit-- == 0) break; int length = x.length(); stat.accept(length); } return stat; }