### Question:
EmptyFileFilter implements FileFilter, Serializable { @Override public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException { try (final FileObject file = fileInfo.getFile()) { if (!file.exists()) { return true; } if (file.getType() == FileType.FOLDER) { final FileObject[] files = file.getChildren(); return files == null || files.length == 0; } try (final FileContent content = file.getContent();) { return content.isEmpty(); } } } protected  EmptyFileFilter(); @Override boolean accept(final FileSelectInfo fileInfo); static final FileFilter EMPTY; static final FileFilter NOT_EMPTY; }### Answer:
@Test public void testAcceptEmpty() throws FileSystemException { final FileFilter testee = EmptyFileFilter.EMPTY; Assert.assertFalse(testee.accept(notEmptyFileInfo)); Assert.assertTrue(testee.accept(emptyFileInfo)); Assert.assertFalse(testee.accept(notEmptyDirInfo)); Assert.assertTrue(testee.accept(emptyDirInfo)); Assert.assertTrue(testee.accept(notExistingFileInfo)); }
@Test public void testAcceptNotEmpty() throws FileSystemException { final FileFilter testee = EmptyFileFilter.NOT_EMPTY; Assert.assertTrue(testee.accept(notEmptyFileInfo)); Assert.assertFalse(testee.accept(emptyFileInfo)); Assert.assertTrue(testee.accept(notEmptyDirInfo)); Assert.assertFalse(testee.accept(emptyDirInfo)); Assert.assertFalse(testee.accept(notExistingFileInfo)); }