### Question:
DefaultExcludesFilenameFilter implements FilenameFilter { public static void setFilterRegex(String filterRegex) { filterPattern = Pattern.compile(filterRegex); }  static void resetFilterPattern(); static void setFilterRegex(String filterRegex); boolean accept(File dir, String name);  }### Answer:
@Test public void testSetFilterRegex() { DefaultExcludesFilenameFilter.setFilterRegex("test"); DefaultExcludesFilenameFilter filter = new DefaultExcludesFilenameFilter(); assertTrue(filter.accept(null, "aaa")); assertFalse(filter.accept(null, "test")); }