@Test public void testResetAfterCancelReturnsFalse() throws IOException { AbstractWatchService.Key key = watcher.register(new StubWatchable(), ImmutableSet.of(ENTRY_CREATE)); key.signal(); key.cancel(); assertThat(key.reset()).isFalse(); }
public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }
AbstractWatchService implements WatchService { public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); } }
AbstractWatchService implements WatchService { public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }  }
AbstractWatchService implements WatchService { public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }  Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes); @VisibleForTesting boolean isOpen(); void cancelled(Key key); @NullableDecl @Override WatchKey poll(); @NullableDecl @Override WatchKey poll(long timeout, TimeUnit unit); @Override WatchKey take(); @Override void close(); }
AbstractWatchService implements WatchService { public Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes) throws IOException { checkOpen(); return new Key(this, watchable, eventTypes); }  Key register(Watchable watchable, Iterable<? extends WatchEvent.Kind<?>> eventTypes); @VisibleForTesting boolean isOpen(); void cancelled(Key key); @NullableDecl @Override WatchKey poll(); @NullableDecl @Override WatchKey poll(long timeout, TimeUnit unit); @Override WatchKey take(); @Override void close();  }