@Override
    public void close() {
        try {
            closeCurrentFile();
            getLogger().fine("Closing StreamFilesP");
            watcher.close();
        } catch (IOException e) {
            getLogger().severe("Failed to close StreamFilesP", e);
        } finally {
            watcher = null;
        }
    }
@Test
    public void when_fileModifiedButNotAppended_then_seeNoLines() throws Exception {
        File file = new File(workDir, "a.txt");
        try (PrintWriter w = new PrintWriter(new FileWriter(file))) {
            for (int i = 0; i < LINE_COUNT; i++) {
                w.println(i);
            }
        }
        initializeProcessor(null);
        // Directory watch service is apparently initialized asynchronously so we
        // have to give it some time. This is a hacky, non-repeatable test.
        Thread.sleep(1000);
        driverThread.start();
        RandomAccessFile raf = new RandomAccessFile(file, "rw");
        raf.write(0xFF);
        raf.close();
        Thread.sleep(5000);
        assertEquals(0, outboxLines.size());
    }