Types { public static WildcardType subtypeOf(Type bound) { return new WildcardTypeImpl(new Type[]{bound}, EMPTY_TYPE_ARRAY); } private  Types(); static ParameterizedType newParameterizedType(Type rawType, Type... typeArguments); static ParameterizedType newParameterizedTypeWithOwner(
            Type ownerType, Type rawType, Type... typeArguments); static GenericArrayType arrayOf(Type componentType); static WildcardType subtypeOf(Type bound); static WildcardType supertypeOf(Type bound); static Class<?> getRawType(Type type); static boolean equals(@Nullable Type a, @Nullable Type b); static Type collectionElementType(Type context, Class<?> contextRawType);  }
@Test public void subtypeOf() throws Exception { Type listOfWildcardType = TypesTest.class.getDeclaredField("listSubtype").getGenericType(); Type expected = Types.collectionElementType(listOfWildcardType, List.class); assertThat(Types.subtypeOf(CharSequence.class), is(equalTo(expected))); }