### Question:
GlusterWatchKey implements WatchKey { @Override synchronized public boolean reset() { if (!valid || ready) { return false; } else { ready = true; return true; } }  @Override boolean isValid(); boolean update(); @Override synchronized List<WatchEvent<?>> pollEvents(); @Override synchronized boolean reset(); @Override void cancel(); @Override Watchable watchable();  }### Answer:
@Test public void testReset_whenInvalid() { key.setValid(false); Assert.assertFalse(key.reset()); }
@Test public void testReset_whenReady() { 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(true); Assert.assertFalse(key.reset()); }