ClassPath implements Iterable<String>, Tabular, Option { public static ClassPath ofClass(Class<?> clazz) throws IOException { if (clazz == null) { throw new NullPointerException("Class must not be null"); } else { while (clazz.getEnclosingClass() != null) { clazz = clazz.getEnclosingClass(); } String resourceName = clazz.getCanonicalName().replace(".", "/") + ".class"; return ofResource(resourceName, clazz.getClassLoader()); } } ClassPath();  ClassPath(ClassPath... classPaths);  ClassPath(Iterable<ClassPath> classPaths);  ClassPath(String... classPaths); int size(); boolean isEmpty(); URL[] getURLs(); boolean contains(String path); boolean contains(ClassPath classPath); @Override Iterator<String> iterator(); @Override String toString(); String toString(OptionsByType optionsByType); String toString(Option... options); @Override Table getTable(); ClassPath excluding(String... exclude); ClassPath excluding(ClassPath exclude); @Override boolean equals(Object other); @Override int hashCode(); static boolean isResourceAnArchive(String resourceName); static String getResourceArchiveType(String resourceName); static ClassPath ofResource(String      resourceName,
                                       ClassLoader classLoader); static ClassPath ofResource(String resourceName); static ClassPath ofClass(Class<?> clazz); static ClassPath ofClass(String      className,
                                    ClassLoader classLoader); static ClassPath ofFile(File file); @OptionsByType.Default static ClassPath ofSystem(); static ClassPath of(Iterable<String> paths); static ClassPath of(ClassPath... classPaths); static ClassPath of(String... classPaths); static final String[] JAVA_ARCHIVE_TYPES; }
@Test public void shouldResolveClassPathOfInnerClass() throws Exception { ClassPath classPath = ClassPath.ofClass(JavaApplication.MetaClass.class); }