### Question:
FileExtensionMatcher implements FileFilter { @Override public boolean accept(File pathname) { return pathname.getName().toLowerCase(Locale.ENGLISH).endsWith(m_extension); } FileExtensionMatcher(String extension); @Override boolean accept(File pathname);  }### Answer:
@Test public void testFilter() { final FileFilter f = new FileExtensionMatcher(".aBc"); assertTrue(f.accept(new File("foo.abc"))); assertTrue(f.accept(new File(".abc"))); assertTrue(f.accept(new File(".aBC"))); assertFalse(f.accept(new File("fooabc"))); assertFalse(f.accept(new File("foo.abcblah"))); assertFalse(f.accept(new File(""))); assertFalse(f.accept(new File(".abc", "x"))); }