### Question:
BaseFileChooserFilter extends FileFilter implements java.io.FileFilter { @Override public boolean accept(File f) { if (isDirectory(f)) { return true; } return type.accept(f); } BaseFileChooserFilter(FileFilterType type); @Override boolean accept(File f); @Override String getDescription();  }### Answer:
@Test public void testJar() { BaseFileChooserFilter victim = new BaseFileChooserFilter(FileFilterType.JAR); File file = mock(File.class); when(file.getAbsolutePath()).thenReturn("/path/chuck.jar"); assertTrue(victim.accept(file)); assertTrue(victim.accept(directory)); assertFalse(victim.accept(null)); }