Type[] paramClasses = method.getGenericParameterTypes();
TypeInfo[] paramTypes = new TypeInfo[paramClasses.length];
for (int i = 0; i < paramClasses.length; ++i)
paramTypes[i] = factory.getTypeInfo(paramClasses[i]);
MethodInfo methodInfo = classInfo.getDeclaredMethod(method.getName(), paramTypes);
assertNotNull(method.getName(), methodInfo);
TypeInfo returnType = factory.getTypeInfo(method.getGenericReturnType());
TypeInfo[] actualParamTypes = methodInfo.getParameterTypes();
for (int i = 0; i < paramTypes.length; ++i)
assertTypeEquals(method.getName() + " param" + i, paramTypes[i], actualParamTypes[i]);
Class<?>[] exceptionClasses = method.getExceptionTypes();
TypeInfo[] expectedExceptionTypes = new TypeInfo[exceptionClasses.length];
for (int i = 0; i < exceptionClasses.length; ++i)
expectedExceptionTypes[i] = factory.getTypeInfo(exceptionClasses[i]);
TypeInfo[] actualExceptionTypes = methodInfo.getExceptionTypes();
for (int i = 0; i < exceptionClasses.length; ++i)
assertTypeEquals(method.getName() + " exception" + i, expectedExceptionTypes[i], actualExceptionTypes[i]);
assertTypeEquals(method.getName() + " returnType", returnType, methodInfo.getReturnType());
assertEquals(classInfo, methodInfo.getDeclaringClass());
assertEquals(method.getModifiers(), methodInfo.getModifiers());
assertMethodAnnotations(method, methodInfo);
assertParameterAnnotations(method, methodInfo);
}