ClassPath implements Iterable<String>, Tabular, Option { public int size() { if (excludes.isEmpty()) { return paths.size(); } else { return (int) paths.stream() .filter(this::include) .count(); } } 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 shouldCopyClassPath() { ClassPath classPath = new ClassPath("simple.jar"); ClassPath copyClassPath = new ClassPath(classPath); Assert.assertEquals(classPath, copyClassPath); Assert.assertNotSame(classPath, copyClassPath); assertThat(classPath.size(), is(1)); }