code: public static <T> Stream<T> toStream(Optional<T> opt) {
      return Arrays.asList(opt.orElse(null)).stream().filter(y -> null != y);
    }
docs: To stream stream.
  
  @param <T> the type parameter
  @param opt the opt
  @return the stream