### Question:
AndFileFilter implements FileFilter, ConditionalFileFilter, Serializable { @Override public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException { if (this.fileFilters.isEmpty()) { return false; } for (final FileFilter fileFilter : fileFilters) { if (!fileFilter.accept(fileInfo)) { return false; } } return true; } AndFileFilter();  AndFileFilter(final FileFilter... filters);  AndFileFilter(final List<FileFilter> fileFilters); @Override boolean accept(final FileSelectInfo fileInfo); @Override void addFileFilter(final FileFilter fileFilter); @Override List<FileFilter> getFileFilters(); @Override boolean removeFileFilter(final FileFilter fileFilter); @Override void setFileFilters(final List<FileFilter> fileFilters); @Override String toString();  }### Answer:
@SuppressWarnings("deprecation") @Test public void testAccept() throws FileSystemException { final FileSelectInfo any = createFileSelectInfo(new File("anyfile")); Assert.assertFalse(new AndFileFilter().accept(any)); Assert.assertTrue(new AndFileFilter(new True()).accept(any)); Assert.assertTrue(new AndFileFilter(new True(), new True()).accept(any)); Assert.assertFalse(new AndFileFilter(new False()).accept(any)); Assert.assertFalse(new AndFileFilter(new False(), new False()).accept(any)); Assert.assertFalse(new AndFileFilter(new False(), new True()).accept(any)); Assert.assertFalse(new AndFileFilter(new True(), new False()).accept(any)); }
@Test public void testAcceptChecked() throws FileSystemException { final FileSelectInfo any = createFileSelectInfo(new File("anyfile")); Assert.assertFalse(new AndFileFilter().accept(any)); Assert.assertTrue(new AndFileFilter(new True()).accept(any)); Assert.assertTrue(new AndFileFilter(new True(), new True()).accept(any)); Assert.assertFalse(new AndFileFilter(new False()).accept(any)); Assert.assertFalse(new AndFileFilter(new False(), new False()).accept(any)); Assert.assertFalse(new AndFileFilter(new False(), new True()).accept(any)); Assert.assertFalse(new AndFileFilter(new True(), new False()).accept(any)); }