private static Class<?> resolveType(final Class<?> targetClass, final Type type) {
        if (type instanceof Class) {
            return (Class<?>)type;
        }

        if (!(type instanceof TypeVariable<?>)) {
            return null;
        }

        Type targetType = null;
        Map<TypeVariable<?>, Type> typeMap = getTypeMap(targetClass);
        for (Map.Entry<TypeVariable<?>, Type> typeVariableEntry : typeMap.entrySet()) {
            TypeVariable<?> typeVariable = typeVariableEntry.getKey();
            if (typeVariable.getName().equals(((TypeVariable)type).getName())) {
                targetType = typeVariableEntry.getValue();
                break;
            }
        }

        if (targetType instanceof Class) {
            return (Class<?>)targetType;
        }
        return null;
    }
resolves the parameter return type of the method
core/src/main/java/com/github/dozermapper/core/util/TypeResolver.java