Types { public static boolean isWildcardType(TypeToken<?> type) { Type javaType = type.getType(); return javaType instanceof WildcardType || (javaType instanceof TypeVariable && ((TypeVariable) javaType).getName().startsWith("capture")); }  static boolean isArrayType(TypeToken<?> type); static boolean isEnumType(TypeToken<?> type); static boolean isMapType(TypeToken<?> type); static boolean isConcreteType(Type type); static boolean isJavaClientEntity(TypeToken<?> type); static boolean isTypeVariable(TypeToken<?> type); static boolean isCollectionResponseType(TypeToken<?> type); static boolean isWildcardType(TypeToken<?> type); static boolean isObject(TypeToken<?> type); static String getSimpleName(TypeToken<?> type, ApiSerializationConfig config); static TypeToken<?> getArrayItemType(TypeToken<?> type); static TypeToken<?> getTypeParameter(TypeToken<?> type, int index);  }
@Test public void isWildcardType() { assertThat(Types.isWildcardType(STRING)).isFalse(); TypeToken<?> t = new TypeToken<Collection<?>>() {}; assertThat(Types.isWildcardType( t.resolveType(((ParameterizedType) t.getType()).getActualTypeArguments()[0]))).isTrue(); t = new TypeToken<Collection<? extends String>>() {}; assertThat(Types.isWildcardType( t.resolveType(((ParameterizedType) t.getType()).getActualTypeArguments()[0]))).isTrue(); }