}
@Test
public void testCancellingLastKeyStopsPolling() throws IOException {
Key key = watcher.register(createDirectory(), ImmutableList.of(ENTRY_CREATE));
key.cancel();
assertThat(key.isValid()).isFalse();
assertThat(watcher.isPolling()).isFalse();
Key key2 = watcher.register(createDirectory(), ImmutableList.of(ENTRY_CREATE));