### Question:
ClassFiles { public static String pathToClassName(String path) { return path.substring(0, path.lastIndexOf(".class")).replace('/', '.'); }  static String classNameToPath(String className); static String pathToClassName(String path);  }### Answer:
@Test public void converting_paths_to_class_names() { assertThat(ClassFiles.pathToClassName("Foo.class"), is("Foo")); assertThat(ClassFiles.pathToClassName("com/example/Foo.class"), is("com.example.Foo")); }