### Question:
Classpath { public static Entry parse(String classpath) { if (classpath.contains(EnvHolder.PATH_SEPARATOR)) { return doParseCompositeEntry(classpath); } Entry entry = parseEntry(classpath); if (entry == null) { throw new IllegalArgumentException("un parse classpath " + classpath); } return entry; }  static Entry parse(String classpath); static Entry doParseCompositeEntry(String classpath); static Entry parseEntry(String path); static Entry doParseWildcard(String path); static Entry doParseJar(String path); static Entry doParseDir(String path); static boolean isDir(String path); static boolean isWildcard(String path); static boolean isJar(String path);  }### Answer:
@Test public void parse() { String home = System.getenv("JAVA_HOME"); Path jarPath = Paths.get(home, "jre", "lib", "rt.jar"); Entry entry = Classpath.parse(jarPath.toFile().getAbsolutePath()); ClassFile cf = entry.findClass("java/lang/Object"); assertNotNull(cf); }
@Test public void parse_2() { String home = System.getenv("JAVA_HOME"); Path jarPath = Paths.get(home, "jre", "lib"); Entry entry = Classpath.parse(exampleJarPath().toFile().getAbsolutePath() + EnvHolder.PATH_SEPARATOR + jarPath.toFile().getAbsolutePath() + EnvHolder.FILE_SEPARATOR +"*"); ClassFile cf = entry.findClass("java/lang/Object"); assertNotNull(cf); }
@Test public void parse_dir() { Entry entry = Classpath.parse(exampleJarPath().toFile().getAbsolutePath()); ClassFile hello = entry.findClass("Hello"); assertNotNull(hello); }