Optional<Integer> (Integer... numbers) { boolean seen = false; Integer acc = null; for (Integer number : numbers) { if (!seen) { seen = true; acc = number; } else { acc = acc * number; } } return seen ? Optional.of(acc) : Optional.empty(); }