code: public static <T> Optional<T[]> getOptional(T[] array) {
          return Optional.ofNullable(array).filter(a -> a.length > 0);
      }
docs: Gets optional.
  
  @param <T>   the type parameter
  @param array the array
  @return the optional