private static boolean isResolvedTypeMatch(
			Method genericMethod, Method candidateMethod, Map<TypeVariable, Type> typeVariableMap) {

		Type[] genericParameters = genericMethod.getGenericParameterTypes();
		Class[] candidateParameters = candidateMethod.getParameterTypes();
		if (genericParameters.length != candidateParameters.length) {
			return false;
		}
		for (int i = 0; i < genericParameters.length; i++) {
			Type genericParameter = genericParameters[i];
			Class candidateParameter = candidateParameters[i];
			if (candidateParameter.isArray()) {
				// An array type: compare the component type.
				Type rawType = GenericTypeResolver.getRawType(genericParameter, typeVariableMap);
				if (rawType instanceof GenericArrayType) {
					if (!candidateParameter.getComponentType().equals(
							GenericTypeResolver.resolveType(((GenericArrayType) rawType).getGenericComponentType(), typeVariableMap))) {
						return false;
					}
					break;
				}
			}
			// A non-array type: compare the type itself.
			Class resolvedParameter = GenericTypeResolver.resolveType(genericParameter, typeVariableMap);
			if (!candidateParameter.equals(resolvedParameter)) {
				return false;
			}
		}
		return true;
	}
private static boolean isResolvedTypeMatch ( Method genericMethod , Method candidateMethod , Map < TypeVariable , Type > typeVariableMap ) { Type [ ] genericParameters = genericMethod . getGenericParameterTypes ( ) ; Class [ ] candidateParameters = candidateMethod . getParameterTypes ( ) ; if ( genericParameters . length != candidateParameters . length ) { return false ; } for ( int i = 0 ; i < genericParameters . length ; i ++ ) { Type genericParameter = genericParameters [ i ] ; Class candidateParameter = candidateParameters [ i ] ; if ( candidateParameter . isArray ( ) ) { Type rawType = GenericTypeResolver . getRawType ( genericParameter , typeVariableMap ) ; if ( rawType instanceof GenericArrayType ) { if ( ! candidateParameter . getComponentType ( ) . equals ( GenericTypeResolver . resolveType ( ( ( GenericArrayType ) rawType ) . getGenericComponentType ( ) , typeVariableMap ) ) ) { return false ; } break ; } } Class resolvedParameter = GenericTypeResolver . resolveType ( genericParameter , typeVariableMap ) ; if ( ! candidateParameter . equals ( resolvedParameter ) ) { return false ; } } return true ; }
Returns {@code true} if the {@link Type} signature of both the supplied
{@link Method#getGenericParameterTypes() generic Method} and concrete {@link Method}
are equal after resolving all {@link TypeVariable TypeVariables} using the supplied
TypeVariable Map, otherwise returns {@code false}.