### Question:
ReflectionUtil { public static Type getGenericParameterType(Class<?> cls, Class<?> genericSuper, int paramIndex) { if (!genericSuper.isAssignableFrom(cls)) throw new IllegalArgumentException("Class " + cls.getName() + " does not implement or extend " + genericSuper.getName()); Type res = getGenericParameterType0(cls, genericSuper, paramIndex); return !(res instanceof TypeVariable) ? res : null; } private  ReflectionUtil(); static T accessible(T obj); static Class<?>[] getTypes(Object... vals); static boolean isAssignable(Class<?>[] classArray, Class<?>[] toClassArray, final boolean autoboxing); static Constructor<T> getMatchingConstructor(final Class<T> cls, final Class<?>... parameterTypes); static boolean isAssignable(Class<?> cls, final Class<?> toClass, final boolean autoboxing); static Class<?> primitiveToWrapper(final Class<?> cls); static Class<?> wrapperToPrimitive(final Class<?> cls); static Type getGenericParameterType(Class<?> cls, Class<?> genericSuper, int paramIndex); static Class<?> getClass(Type type); static Class<?>[] getParameterTypes(Member m);  }### Answer:
@Test public void testGetGenericParameter1() { Class<?> res = (Class<?>) ReflectionUtil.getGenericParameterType(D.class, A.class, 0); assertEquals(res, String.class); }
@Test public void testGetGenericParameter3() { Class<?> res = (Class<?>) ReflectionUtil.getGenericParameterType(E.class, A.class, 0); assertEquals(res, String.class); }
@Test public void testGetGenericParameterInterface1() { Class<?> res = (Class<?>) ReflectionUtil.getGenericParameterType(ID.class, IA.class, 0); assertEquals(res, String.class); }
@Test public void testGetGenericParameterInterface3() { Class<?> res = (Class<?>) ReflectionUtil.getGenericParameterType(IE.class, IA.class, 0); assertEquals(res, String.class); }