### Question:
SizeFileFilter implements FileFilter, Serializable { @Override public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException { try (final FileObject file = fileInfo.getFile()) { if (!file.exists()) { return false; } try (final FileContent content = file.getContent();) { final long length = content.getSize(); final boolean smaller = length < size; return acceptLarger ? !smaller : smaller; } } } SizeFileFilter(final long size);  SizeFileFilter(final long size, final boolean acceptLarger); @Override boolean accept(final FileSelectInfo fileInfo); @Override String toString();  }### Answer:
@Test public void testSizeFileFilterLong() throws FileSystemException { final SizeFileFilter testee = new SizeFileFilter(4); Assert.assertFalse(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertTrue(testee.accept(maxFileInfo)); }
@Test public void testSizeFileFilterLongBoolean() throws FileSystemException { SizeFileFilter testee; testee = new SizeFileFilter(4, true); Assert.assertFalse(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertTrue(testee.accept(maxFileInfo)); testee = new SizeFileFilter(4, false); Assert.assertTrue(testee.accept(minFileInfo)); Assert.assertFalse(testee.accept(optFileInfo)); Assert.assertFalse(testee.accept(maxFileInfo)); }
@Test public void testSizeRangeFileFilter() throws FileSystemException { SizeRangeFileFilter testee; testee = new SizeRangeFileFilter(2, 6); Assert.assertTrue(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertTrue(testee.accept(maxFileInfo)); testee = new SizeRangeFileFilter(3, 6); Assert.assertFalse(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertTrue(testee.accept(maxFileInfo)); testee = new SizeRangeFileFilter(2, 5); Assert.assertTrue(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertFalse(testee.accept(maxFileInfo)); testee = new SizeRangeFileFilter(3, 5); Assert.assertFalse(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertFalse(testee.accept(maxFileInfo)); testee = new SizeRangeFileFilter(4, 4); Assert.assertFalse(testee.accept(minFileInfo)); Assert.assertTrue(testee.accept(optFileInfo)); Assert.assertFalse(testee.accept(maxFileInfo)); }