code: @SneakyThrows
      public static <T, R> Function<T, R> doIf(final Predicate<Object> condition, final Supplier<R> trueFunction,
                                               final Supplier<R> falseFunction) {
          return t -> {
              try {
                  if (condition.test(t)) {
                      return trueFunction.get();
                  }
                  return falseFunction.get();
              } catch (final Throwable e) {
                  LOGGER.warn(e.getMessage(), e);
                  return falseFunction.get();
              }
          };
      }
docs: Do if function.
  
  @param <T>           the type parameter
  @param <R>           the type parameter
  @param condition     the condition
  @param trueFunction  the true function
  @param falseFunction the false function
  @return the function