### Question:
ChangeFileFilter implements FileFilter { @Override public boolean accept(File pathname) { if (!pathname.canRead()) { LOG.warn("Unable to read potential change file " + pathname.getAbsolutePath()); return false; } return pathname.isFile() && pathname.getName().toUpperCase().endsWith(".XML"); }  @Override boolean accept(File pathname);  }### Answer:
@Test public void shouldIgnoreCase() throws Exception { when(file.getName()).thenReturn("something.xML"); boolean result = filter.accept(file); assertTrue(result); }
@Test public void shouldFilterDirectory() throws Exception { when(file.isFile()).thenReturn(false); boolean result = filter.accept(file); assertFalse(result); }
@Test public void shouldFilterRestrictedFiles() throws Exception { when(file.canRead()).thenReturn(false); boolean result = filter.accept(file); assertFalse(result); }