IntSummaryStatistics () { IntSummaryStatistics stat = new IntSummaryStatistics(); for (int x = 0; x < 20; x++) { if (x > 2) { long limit = x; for (String s = String.valueOf(x); ; s = s + x) { if (limit-- == 0) break; int length = s.length(); stat.accept(length); } } } return stat; }