code: public static <T, R> Optional<R> functionIfTrue(boolean bool, T target,
              Function<T, R> function) {
          return supplierIfTrue(bool, () -> function.apply(target));
      }
docs: Function if true optional.
  
  @param <T>      the type parameter
  @param <R>      the type parameter
  @param bool     the bool
  @param target   the target
  @param function the function
  @return the optional