예제 #1
0
 public void testResolveToGenericArrayType() {
   GenericArrayType arrayType =
       (GenericArrayType) new Holder<List<int[][]>[]>() {}.getContentType();
   ParameterizedType listType = (ParameterizedType) arrayType.getGenericComponentType();
   assertEquals(List.class, listType.getRawType());
   assertEquals(Types.newArrayType(int[].class), listType.getActualTypeArguments()[0]);
 }
예제 #2
0
 public void testGenericArrayType() {
   GenericArray<?> genericArray = new GenericArray<Integer>();
   assertEquals(GenericArray.class.getTypeParameters()[0], genericArray.t);
   assertEquals(Types.newArrayType(genericArray.t), genericArray.array);
 }