public static <T> Collector<T, ?, Optional<T>> toOptional() {
        return OptionalCollectors.toOptional(Optional::absent, Optional::of);
    }
Returns a {@code Collector} that accumulates 0 or 1 input elements into Guava's {@code Optional<T>}.
The returned collector will throw {@code IllegalStateException} whenever 2 or more elements
are present in a stream. Null elements are mapped to {@code Optional.absent()}.

@param <T> the collected type
@return a {@code Collector} which collects 0 or 1 input elements into a Guava {@code Optional<T>}.
guava/src/main/java/org/jdbi/v3/guava/GuavaCollectors.java