@Test
public void testScanDirectory() throws Throwable {

	final Path root = Paths.get(getClass().getResource("/documents/text/").toURI());
	// Block until every single path has been scanned and queued.
	final Future<Long> job = scanner.scan(root);
	assertEquals(3L, (long)job.get());
	shutdownScanner(scanner);
	// Assert that the queue contains at least one file, manually.
	Assert.assertTrue(Files.exists(root.resolve("plain.txt")));
	Assert.assertTrue(String.format("Queued file path must start with root path \"%s\".", root),
			queue.contains(root.resolve("plain.txt")));
	try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(root)) {
		for (Path file : directoryStream) {
			Assert.assertTrue(String.format("Failed asserting that queue contains \"%s\".", file),
					queue.contains(file));
		}
	}
}