### Question:
GenericUtils { public static <T> Class<T> parentGenericClass(Class<T> clazz) { Type genericSuperclass = clazz.getGenericSuperclass(); if (genericSuperclass == null) { throw new RuntimeException(Info.get(GenericUtils.class, R.NO_GENERIC_SUPER_CLASS)); } if (genericSuperclass instanceof ParameterizedType) { Class<T> genericClass = (Class<T>) ((ParameterizedType) genericSuperclass).getActualTypeArguments()[0]; return genericClass; } else { throw new RuntimeException( Info.get(GenericUtils.class, R.NO_GENERIC_SUPER_CLASS, clazz.getGenericSuperclass().getTypeName())); } }  static Class<T> ancestorGenericClass(Class<T> clazz); static Class<T> parentGenericClass(Class<T> clazz); static ParameterizedType firstParameterizedType(Class<T> clazz); static Class genericClass(Class<T> clazz);  }### Answer:
@Test public void testParentGenericClass() { Assertions.assertThrows(RuntimeException.class, () -> GenericUtils.parentGenericClass(AAA.class)); Assertions.assertSame(LinkedList.class, GenericUtils.parentGenericClass(BBB.class)); Assertions.assertThrows(RuntimeException.class, () -> GenericUtils.parentGenericClass(CCC.class)); Assertions.assertThrows(RuntimeException.class, () -> GenericUtils.parentGenericClass(DDD.class)); }