Utils { public static String toStandardJavaClassName(final String rootPath, final String classFilePath) { if (rootPath.length() >= classFilePath.length()) { throw new Error("Unexpected situation #112321223 (" + rootPath + " >= " + classFilePath + ')'); } String diff = classFilePath.substring(rootPath.length()).replace('\\', '.').replace('/', '.'); if (diff.toLowerCase(Locale.ENGLISH).endsWith(".class")) { diff = diff.substring(0, diff.length() - ".class".length()); } return diff; } private  Utils(); static boolean checkClassAndMethodForPattern(final String juteTest, final String className, final String methofName, final boolean onlyClass); static String printTimeDelay(final long timeInMilliseconds); static int getMaxLineWidth(final List<String> str); static String makeStr(final int len, final char ch); static List<String> splitToLines(final String str); static int calcNumberOfItems(final Map<TestClassProcessor, List<TestContainer>> map); static List<TestContainer> sortDetectedClassMethodsForNameAndOrder(final List<TestContainer> testMethods); static String toStandardJavaClassName(final String rootPath, final String classFilePath); static final String lineSeparator; }
@Test public void testToStandardJavaClassName(){ assertEquals("some.package.Klazz$Hello",Utils.toStandardJavaClassName("/root/","/root/some/package/Klazz$Hello.class")); assertEquals("some.package.Klazz$Hello",Utils.toStandardJavaClassName("/root/","/root/some/package/Klazz$Hello")); }