### Question:
WatchDir implements AutoCloseable { @Nonnull @ReturnsMutableCopy public static WatchDir createAsyncRunningWatchDir (@Nonnull final Path aDir, final boolean bRecursive, @Nonnull final IWatchDirCallback aCallback) throws IOException { final WatchDir ret = new WatchDir (aDir, bRecursive); ret.callbacks ().add (aCallback); ret.runAsync (); return ret; } WatchDir(@Nonnull final Path aDir, final boolean bRecursive); @Nonnull @ReturnsMutableObject CallbackList <IWatchDirCallback> callbacks(); @Nonnull Path getStartDirectory(); boolean isRecursive(); void close(); void stopProcessing(); boolean isProcessing(); void processEvents(); void runAsync(); @Nonnull @ReturnsMutableCopy static WatchDir createAsyncRunningWatchDir(@Nonnull final Path aDir,
                                                     final boolean bRecursive,
                                                     @Nonnull final IWatchDirCallback aCallback);  }### Answer:
@Test @Ignore ("Manually tested and considered to be working. Takes too long.") public void testNonRecursive () throws IOException { final IWatchDirCallback aCB = (eAction, aPath) -> LOGGER.info ("CB: " + eAction + " - " + aPath); try (final WatchDir aWatch = WatchDir.createAsyncRunningWatchDir (Paths.get ("."), false, aCB)) { ThreadHelper.sleep (10, TimeUnit.SECONDS); } }