ClassNameUtils { public static Optional<String> toInnerClassName(final String name) { if (name.contains("$")) { return Optional.of(name); } final int sep = name.lastIndexOf('.'); if (sep > 0) { return Optional.of(name.substring(0, sep) + '$' + name.substring(sep + 1)); } return Optional.empty(); } 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 innerClassName1() throws Exception { String name = "java.util.Map.Entry"; final Optional<String> innerClassName = ClassNameUtils.toInnerClassName(name); assertEquals("java.util.Map$Entry", innerClassName.get()); }
@Test public void innerClassName2() throws Exception { String name = "java.util.Map$Entry"; final Optional<String> innerClassName = ClassNameUtils.toInnerClassName(name); assertEquals("java.util.Map$Entry", innerClassName.get()); }