code: @Beta
      public static <T, R> Function<T, R> sf(final Object mutex, final Function<T, R> function) {
          N.checkArgNotNull(mutex, "mutex");
          N.checkArgNotNull(function, "function");
  
          return new Function<T, R>() {
              @Override
              public R apply(T t) {
                  synchronized (mutex) {
                      return function.apply(t);
                  }
              }
          };
      }
docs: Synchronized {@code Function}
  
  @param mutex to synchronized on
  @param function
  @return