@Beta
    public static <T, U, R> BiFunction<T, U, R> sf(final Object mutex, final BiFunction<T, U, R> biFunction) {
        N.checkArgNotNull(mutex, "mutex");
        N.checkArgNotNull(biFunction, "biFunction");

        return new BiFunction<T, U, R>() {
            @Override
            public R apply(T t, U u) {
                synchronized (mutex) {
                    return biFunction.apply(t, u);
                }
            }
        };
    }
@ Beta public static < T , U , R > BiFunction < T , U , R > sf ( final Object mutex , final BiFunction < T , U , R > biFunction ) { N . checkArgNotNull ( mutex , "mutex" ) ; N . checkArgNotNull ( biFunction , "biFunction" ) ; return new BiFunction < T , U , R > ( ) { @ Override public R apply ( T t , U u ) { synchronized ( mutex ) { return biFunction . apply ( t , u ) ; } } } ; }
Synchronized {@code BiFunction}

@param mutex to synchronized on
@param biFunction
@return