ReflectionUtils { public static <T> Class<?>[] getTypeArguments( Class<T> baseClass, Class<? extends T> childClass) { return TypeResolver.resolveArguments(childClass, baseClass); } private  ReflectionUtils(); static String getPackagePath(Object object); static String getPackagePath(Class klass); static Class<?>[] getTypeArguments(
      Class<T> baseClass, Class<? extends T> childClass); @SuppressWarnings("unchecked") static T newInstance(Class<T> theClass); @SuppressWarnings("unchecked") static T newInstance(
      Class<T> theClass,
      ImmutableClassesGiraphConfiguration configuration); static T newInstance(
      Class<T> theClass,
      ImmutableClassesGiraphConfiguration configuration,
      Mapper<?, ?, ?, ?>.Context context); static void verifyTypes(Class<?> concreteChild, Class<?> parent,
      String typeDesc, Class<?> mainClass); static void verifyConcrete(
      Class<?> concrete, String typeDesc);  }
@Test public void testInferWithGenerics() { Class<?>[] classes = getTypeArguments(VertexResolver.class, DefaultVertexResolver.class); assertEquals(3, classes.length); assertEquals(WritableComparable.class, classes[0]); assertEquals(Writable.class, classes[1]); assertEquals(Writable.class, classes[2]); classes = getTypeArguments(VertexIdFactory.class, DefaultVertexIdFactory.class); assertEquals(1, classes.length); assertEquals(WritableComparable.class, classes[0]); classes = getTypeArguments(VertexValueFactory.class, DefaultVertexValueFactory.class); assertEquals(1, classes.length); assertEquals(Writable.class, classes[0]); classes = getTypeArguments(EdgeValueFactory.class, DefaultEdgeValueFactory.class); assertEquals(1, classes.length); assertEquals(Writable.class, classes[0]); classes = getTypeArguments(MessageValueFactory.class, DefaultMessageValueFactory.class); assertEquals(1, classes.length); assertEquals(Writable.class, classes[0]); classes = getTypeArguments(OutEdges.class, ByteArrayEdges.class); assertEquals(2, classes.length); assertEquals(WritableComparable.class, classes[0]); assertEquals(Writable.class, classes[1]); }