code: public static <T, C extends Collection<T>> Optional<C>
      getOptional(C collection) {
          return Optional.ofNullable(collection).filter(c -> c.size() > 0);
      }
docs: Gets optional.
  
  @param <T>        the type parameter
  @param <C>        the type parameter
  @param collection the collection
  @return the optional