src/main/java/j2html/TagCreator.java
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    public static <T, U> T iff(Optional<U> optional, Function<U, T> ifFunction) {
        if (Objects.nonNull(optional) && optional.isPresent()) {
            return optional.map(ifFunction).orElse(null);
        }
        return null;
    }
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    public static <T, U> T iff(Optional<U> optional, Function<U, T> ifFunction) {
        if (Objects.nonNull(optional) && optional.isPresent()) {
            return optional.map(ifFunction).orElse(null);
        }
        return null;
    }
Generic if-expression to if'ing inside method calls

@param optional   The item that may be present
@param ifFunction The function that will be called if that optional is present
@param <T>        The derived generic parameter type
@param <U>        The supplying generic parameter type
@return transformed value if condition is true, null otherwise