@Override
    public B applyOrElse(A x, Function<? super A, ? extends B> that) {
        if (f1.isDefinedAt(x)) {
            return f1.apply(x);
        } else {
            return f2.applyOrElse(x, that);
        }
    }
Work exactly same as scala's PartialFunction.

@param <A> argument type
@param <B> result type
indexr-common/src/main/java/io/indexr/util/function/PartialFunction.java