### Question:
GlusterWatchKey implements WatchKey { @Override public void cancel() { valid = false; }  @Override boolean isValid(); boolean update(); @Override synchronized List<WatchEvent<?>> pollEvents(); @Override synchronized boolean reset(); @Override void cancel(); @Override Watchable watchable();  }### Answer:
@Test public void testCancel() { WatchEvent.Kind[] kinds = new WatchEvent.Kind[]{mock(WatchEvent.Kind.class)}; GlusterPath path = mock(GlusterPath.class); GlusterWatchKey key = new GlusterWatchKey(path, kinds); key.setValid(true); key.setReady(false); assertTrue(key.reset()); assertTrue(key.isReady()); }