code: public static <R> Optional<R> supplierIfTrue(boolean bool,
              Supplier<R> supplier) {
          return bool ? Optional.ofNullable(supplier.get()) : Optional.empty();
      }
docs: Supplier if true optional.
  
  @param <R>      the type parameter
  @param bool     the bool
  @param supplier the supplier
  @return the optional