presto-tpch/src/main/java/io/prestosql/plugin/tpch/util/Optionals.java/Optionals/withBoth
class Optionals:    public static <S, T, R> Optional<R> withBoth(Optional<? extends S> left, Optional<? extends T> right, BiFunction<S, T, R> binaryFunction)
    {
        return left.flatMap(l -> right.map(r -> binaryFunction.apply(l, r)));
    }