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