StreamFilesP extends AbstractProcessor { @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; } } StreamFilesP(
            @Nonnull String watchedDirectory,
            @Nonnull Charset charset,
            @Nonnull String glob,
            boolean sharedFileSystem,
            @Nonnull BiFunctionEx<? super String, ? super String, ? extends R> mapOutputFn
    ); @Override boolean isCooperative(); @Override void close(); @Override boolean complete(); @Nonnull static ProcessorMetaSupplier metaSupplier(
            @Nonnull String watchedDirectory,
            @Nonnull String charset,
            @Nonnull String glob,
            boolean sharedFileSystem,
            @Nonnull BiFunctionEx<? super String, ? super String, ?> mapOutputFn
    );  }
@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); Thread.sleep(1000); driverThread.start(); RandomAccessFile raf = new RandomAccessFile(file, "rw"); raf.write(0xFF); raf.close(); Thread.sleep(5000); assertEquals(0, outboxLines.size()); }