ClassNameUtils { public static String getAllSimpleName(final String name) { final String base = ClassNameUtils.removeTypeParameter(ClassNameUtils.getSimpleName(name)); StringBuilder sb = new StringBuilder(base); final List<String> parameters = ClassNameUtils.parseTypeParameter(name); if (parameters.size() > 0) { sb.append('<'); List<String> temp = new ArrayList<>(parameters.size()); for (final String s : parameters) { final String simpleName = ClassNameUtils.getSimpleName(s); if (simpleName.indexOf('<') > 0) { temp.add(getAllSimpleName(simpleName)); } else { temp.add(simpleName); } } sb.append(Joiner.on(", ").join(temp)); sb.append('>'); } return sb.toString(); } private  ClassNameUtils(); static boolean isPrimitive(final String className); static boolean isArray(final String name); static String replaceFromMap(final String string, final Map<String, String> replacements); static String replaceDot2FileSep(final String string); static String replaceSlash(String string); static String getParentClass(final String name); static String replaceInnerMark(final String string); static String replaceDotToInnerMark(String string, boolean last); static String removeTypeMark(final String val); static Optional<String> toInnerClassName(final String name); static boolean hasPackage(String name); static String getSimpleName(final String fqcn); static String getPackage(final String fqcn); static Optional<String> getTypeVariable(final String val); static String removeTypeParameter(String name); static String removeTypeAndArray(String name); static List<String> parseTypeParameter(final String str); static String removeCapture(final String name); static String removeCaptureAndWildCard(final String name); static String getAllSimpleName(final String name); static String removeWildcard(final String name); static boolean compareArgumentType(
      List<String> arguments, List<String> parameters, boolean hasVarargs); static boolean isAnonymousClass(final String name); static void replaceDescriptorsType(
      final String nameWithTP, final List<MemberDescriptor> members); static String getClassName(final String s); static final String OBJECT_CLASS; static final String OBJECT; static final String CLASS_TYPE_VARIABLE_MARK; static final String FORMAL_TYPE_VARIABLE_MARK; static final String INNER_MARK; static final String CAPTURE_OF; static final String ARRAY; }
@Test public void getAllSimpleName1() throws Exception { String name = "java.util.function.Function<java.utils.List, java.util.Map>"; final String s = ClassNameUtils.getAllSimpleName(name); assertEquals("Function<List, Map>", s); }
@Test public void getAllSimpleName2() throws Exception { String name = "java.util.function.Function<java.utils.List<java.lang.List<java.io.File>>>"; final String s = ClassNameUtils.getAllSimpleName(name); assertEquals("Function<List<List<File>>>", s); }