FileExtensionList { public Set<String> getExtensions() { return existingExtensions; } FileExtensionList(final List<DirEntry> entries); Set<String> getExtensions();  }
@Test public void testGetExtensions() throws Exception { assertEquals(0, new FileExtensionList(new ArrayList<DirEntry>()).getExtensions().size()); final List<DirEntry> entries = getFileEntriesDirectoryList(); assertEquals(3, new FileExtensionList(entries).getExtensions().size()); entries.add(new DirEntry("/", "anothertest.jpg", "", null, DirEntry.Kind.FILE, 0, 0)); assertEquals(3, new FileExtensionList(entries).getExtensions().size()); }