Can I use FileNameExtensionFilter to filter out a list of files?
<p>I have a large collection with many entries: <code>Set&lt;File&gt; allFiles</code>.</p>

<p><strong>Is it practical</strong> to iterate through this Set using the following algorithm? Are there better ways to do it?</p>

<pre><code>Set&lt;File&gt; allFiles = // ...100,000+ entries
Set&lt;File&gt; filteredList = new LinkedHashSet&lt;File&gt;();

FileNameExtensionFilter filter = new FileNameExtensionFilter("Extensions accepted", "a", "b", "c");

for (File file : allFiles) {
    if (filter.accept(file)) {
        filteredList.add(file);
    }
}
</code></pre>

<p>In case anyone is asking, the <code>allFiles</code> Set is pre-populated elsewhere, and not necessarily gleaned using the File.listFiles() method.</p>
