@SafeVarargs
    public static <T> Optional<T> firstNonEmpty(Optional<T>... optionals) {
        for (Optional<T> optional : optionals)
            if (optional.isPresent())
                return optional;
        return Optional.empty();
    }
Returns the first non-empty optional, or empty if all are empty.
vespajlib/src/main/java/com/yahoo/collections/Optionals.java