map generics

I am trying to map generics like this:

    public static <T, X> Nullable<X> jsonNullableToNullable(JsonNullable<T> jsonNullable) {
        if (jsonNullable.isPresent()) {
            return Nullable.of(jsonNullable.get());
        }
        return Nullable.undefined();
    }

But how do I tell mapstruct in line return Nullable.of(jsonNullable.get()) to call the appropriate mapper to map from T to X?

I have also opened a stackoverflow question with all the details: https://stackoverflow.com/questions/66452786/mapstruct-wrapper-type-and-generics