### Question:
GlusterWatchKey implements WatchKey { @Override synchronized public List<WatchEvent<?>> pollEvents() { if (!ready) { return new LinkedList<>(); } ready = false; return findPendingEvents(); }  @Override boolean isValid(); boolean update(); @Override synchronized List<WatchEvent<?>> pollEvents(); @Override synchronized boolean reset(); @Override void cancel(); @Override Watchable watchable();  }### Answer:
@Test public void testPollEvents_whenNotReady() { key.setReady(false); assertTrue(key.pollEvents().isEmpty()); }