IntSummaryStatistics (int... values) { IntSummaryStatistics stat = new IntSummaryStatistics(); long toSkipOuter = 2; for (int x : values) { if (toSkipOuter > 0) { toSkipOuter--; continue; } if (x > 0) { long toSkip = x; for (int i = 0; i < 100; i++) { if (toSkip > 0) { toSkip--; continue; } stat.accept(i); } } } return stat; }