code: public static <T> Collector<T, ?, Optional<T>> onlyOne(Predicate<? super T> predicate) {
          return filtering(predicate, onlyOne());
      }
docs: Returns a {@code Collector} which collects the stream element satisfying the predicate
  if there is only one such element.
  
  <p>
  This method returns a
  <a href="package-summary.html#ShortCircuitReduction">short-circuiting
  collector</a>.
  
  @param predicate a predicate to be applied to the stream elements
  @param <T> the type of the input elements
  @return a collector which returns an {@link Optional} describing the only
  element of the stream satisfying the predicate. If stream contains no elements satisfying the predicate,
  or more than one such element, an empty {@code Optional} is returned.
  @since 0.6.7