DirectoryConfigs extends LinkedHashSet<DirectoryConfig> { public DirectoryConfig removePath(String path) { for (DirectoryConfig d : this) { if (d.getDirectoryPath().equals(path)) { this.remove(d); return d; } } return null; }  List<File> toFileList(); DirectoryConfig removePath(String path);  }
@Test public void testRemovePath() { DirectoryConfigs dc = new DirectoryConfigs(); String testPath = "path"; dc.add(new DirectoryConfig(testPath)); Assert.assertEquals(1, dc.size()); dc.removePath(testPath); Assert.assertEquals(0, dc.size()); }