### Question:
WatcherFactory { public Watcher getWatcher() throws IOException { if (JAVA_VERSION >= 1.7) { if (IS_WINDOWS) { return new TreeWatcherNIO(); } else { return new WatcherNIO2(); } } else { throw new UnsupportedOperationException("Watcher is implemented only for Java 1.7 (NIO2). " + "JNotify implementation should be added in the future for older Java version support."); } }  Watcher getWatcher(); static double JAVA_VERSION; static boolean IS_WINDOWS; }### Answer:
@Test public void testGetWatcher() throws Exception { assertNotNull(new WatcherFactory().getWatcher()); }