public static Collector<Integer, ?, OptionalInt> toOptionalInt() {
        return toOptional(OptionalInt::empty, OptionalInt::of);
    }
Returns a {@code Collector} that accumulates 0 or 1 input {@code Integer} elements into an
{@code OptionalInt}. The returned collector will throw {@code IllegalStateException} whenever
2 or more elements are present in a stream. Null elements are mapped to
{@code OptionalInt.empty()}.

@return a {@code Collector} which collects 0 or 1 input {@code Integer} elements into an
{@code OptionalInt}.
core/src/main/java/org/jdbi/v3/core/collector/OptionalCollectors.java