@Test public void shouldDecapitalizeSomeCharsUntilItFindsOneUppercasedForListsAndArrays() throws NoSuchMethodException, SecurityException, NoSuchFieldException { Assert.assertEquals("stringList",extractor.nameFor(getField("strings"))); Assert.assertEquals("bigDecimalList",extractor.nameFor(getField("bigs"))); Assert.assertEquals("hashSet",extractor.nameFor(getField("bigsOld"))); Assert.assertEquals("class",extractor.nameFor(getField("clazz"))); Assert.assertEquals("aClassList",extractor.nameFor(AClass[].class)); Assert.assertEquals("urlClassLoaderList",extractor.nameFor(getField("urls"))); }
public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); } }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  String nameFor(Type generic); }
DefaultTypeNameExtractor implements TypeNameExtractor { public String nameFor(Type generic) { if (generic instanceof ParameterizedType) { return nameFor((ParameterizedType) generic); } if (generic instanceof WildcardType) { return nameFor((WildcardType) generic); } if (generic instanceof TypeVariable<?>) { return nameFor((TypeVariable<?>) generic); } return nameFor((Class<?>) generic); }  String nameFor(Type generic);  }