import com.alibaba.citrus.generictype.MethodInfo;
public class GenericTest {
public static void main(String[] args) throws Exception {
// Class3
ClassTypeInfo class3 = factory.getClassType(Class3.class);
System.out.printf("Context class: %s\n", class3);
// Class1.getArrayList()
MethodInfo getArrayList = factory.getMethod(Class1.class.getMethod("getArrayList"));
System.out.printf("Method: %s\n", getArrayList);
// ArrayList<A>
ClassTypeInfo returnType = (ClassTypeInfo) getArrayList.getReturnType();
System.out.printf("Return type of method: %s\n", returnType);
// resolve ArrayList<A>
ClassTypeInfo resolvedType = returnType.resolve(class3);
System.out.printf("Resolved returnType: %s\n", resolvedType);
System.out.printf("Argument of resolved returnType: %s\n", resolvedType.getActualTypeArguments().get(0));
}