docs: @Deprecated
  	public static Class<?> resolveReturnTypeForGenericMethod(Method method, Object[] args) {
  		Assert.notNull(method, "Method must not be null");
  		Assert.notNull(args, "Argument array must not be null");
  
  		TypeVariable<Method>[] declaredTypeVariables = method.getTypeParameters();
  		Type genericReturnType = method.getGenericReturnType();
  		Type[] methodArgumentTypes = method.getGenericParameterTypes();
  
  		// No declared type variables to inspect, so just return the standard return type.
  		if (declaredTypeVariables.length == 0) {
  			return method.getReturnType();
  		}
  
  		// The supplied argument list is too short for the method's signature, so
  		// return null, since such a method invocation would fail.
  		if (args.length < methodArgumentTypes.length) {
  			return null;
  		}
  
  		// Ensure that the type variable (e.g., T) is declared directly on the method
  		// itself (e.g., via <T>), not on the enclosing class or interface.
  		boolean locallyDeclaredTypeVariableMatchesReturnType = false;
  		for (TypeVariable<Method> currentTypeVariable : declaredTypeVariables) {
  			if (currentTypeVariable.equals(genericReturnType)) {
  				locallyDeclaredTypeVariableMatchesReturnType = true;
  				break;
  			}
  		}
  
  		if (locallyDeclaredTypeVariableMatchesReturnType) {
  			for (int i = 0; i < methodArgumentTypes.length; i++) {
  				Type currentMethodArgumentType = methodArgumentTypes[i];
  				if (currentMethodArgumentType.equals(genericReturnType)) {
  					return args[i].getClass();
  				}
  				if (currentMethodArgumentType instanceof ParameterizedType) {
  					ParameterizedType parameterizedType = (ParameterizedType) currentMethodArgumentType;
  					Type[] actualTypeArguments = parameterizedType.getActualTypeArguments();
  					for (Type typeArg : actualTypeArguments) {
  						if (typeArg.equals(genericReturnType)) {
  							if (args[i] instanceof Class) {
  								return (Class<?>) args[i];
  							}
  							else {
  								// Consider adding logic to determine the class of the typeArg, if possible.
  								// For now, just fall back...
  								return method.getReturnType();
  							}
  						}
  					}
  				}
  			}
  		}
  
  		// Fall back...
  		return method.getReturnType();
  	}