@Test(expected = IllegalStateException.class) public void superclassIsNotAssignableFromSubclass() { try { GenericsUtil.fromGenericType(Long.class, Integer.class, 0); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("is no subclass of"); throw e; } }
public static <V> Class<V> fromGenericType(Class<?> subclass, Class<?> superclass) { return fromGenericType(subclass, null, superclass, 0); }
GenericsUtil { public static <V> Class<V> fromGenericType(Class<?> subclass, Class<?> superclass) { return fromGenericType(subclass, null, superclass, 0); } }
GenericsUtil { public static <V> Class<V> fromGenericType(Class<?> subclass, Class<?> superclass) { return fromGenericType(subclass, null, superclass, 0); } private  GenericsUtil(); }
GenericsUtil { public static <V> Class<V> fromGenericType(Class<?> subclass, Class<?> superclass) { return fromGenericType(subclass, null, superclass, 0); } private  GenericsUtil(); static Class<V> fromGenericType(Class<?> subclass, Class<?> superclass); static Class<V> fromGenericType(Type subtype, Class<?> superclass, int parameterIndex); static Class<V> fromGenericType(Class<?> subclass, ParameterizedType subtype, Class<?> superclass, int parameterIndex); static ParameterizedType getParameterizedType(Type type); static Class<T> getRawType(Type type); }
GenericsUtil { public static <V> Class<V> fromGenericType(Class<?> subclass, Class<?> superclass) { return fromGenericType(subclass, null, superclass, 0); } private  GenericsUtil(); static Class<V> fromGenericType(Class<?> subclass, Class<?> superclass); static Class<V> fromGenericType(Type subtype, Class<?> superclass, int parameterIndex); static Class<V> fromGenericType(Class<?> subclass, ParameterizedType subtype, Class<?> superclass, int parameterIndex); static ParameterizedType getParameterizedType(Type type); static Class<T> getRawType(Type type);  }