OptionalInt () { boolean seen = false; int acc = 0; for (int i : new int[]{}) { if (!seen) { seen = true; acc = i; } else { acc = acc * i; } } return seen ? OptionalInt.of(acc) : OptionalInt.empty(); }