code: public static <T, U, R extends Number> ToDoubleBiFunction<T, U> unbox(
          final BiFunction<T, U, R> f, final double returnValueForNull)
      {
          return new ToDoubleBiFunction<T, U>()
          {
              @Override
              public double applyAsDouble(T t, U u)
              {
                  Number result = f.apply(t, u);
                  if (result == null)
                  {
                      return returnValueForNull;
                  }
                  return result.doubleValue();
              }
          };
      }
docs: Returns a view on the given BiFunction as a ToDoubleBiFunction that
  thus unboxing the return type from a <code>Number</code>
  (like <code>Double</code>) to <code>double</code>
  
  @param <T> The first argument type
  @param <U> The second argument type
  @param <R> The return value type
  @param f The function
  @param returnValueForNull The return value that should be used
  when the given delegate function returns <code>null</code>
  @return The unboxed function