@Override
    public C applyOrElse(A x, Function<? super A, ? extends C> that) {
        if (pf.isDefinedAt(x)) {
            return k.apply(pf.apply(x));
        }
        return that.apply(x);
    }
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