@Test
public void testIgnoreHiddenFiles() throws Throwable {

	final Path root = Paths.get(getClass().getResource("/documents/").toURI());
	final Path hidden = root.resolve(".hidden");
	scanner.ignoreHiddenFiles(true);
	Assert.assertTrue(scanner.ignoreHiddenFiles());
	// Block until every single path has been scanned and queued.
	assertEquals(10, (long)scanner.scan(root).get());
	// Assert that the queue does not contain the hidden file.
	Assert.assertTrue(Files.exists(hidden));
	Assert.assertFalse(queue.contains(hidden));
	// Now test if hidden files are scanned.
	scanner.ignoreHiddenFiles(false);
	Assert.assertFalse(scanner.ignoreHiddenFiles());
	assertEquals(11, (long)scanner.scan(root).get());
	Assert.assertTrue(queue.contains(hidden));
	shutdownScanner(scanner);
}