ExpiringSet { public void shutdown() { scheduler.shutdownNow(); synchronized (set) { set.clear(); } } ExpiringSet(int expireSeconds); boolean contains(final E key); void shutdown();  }
@Test public void testShutdown() throws InterruptedException { ExpiringSet<String> expiringSet = new ExpiringSet<String>(2); assertFalse(expiringSet.contains("hello")); assertTrue(expiringSet.contains("hello")); expiringSet.shutdown(); }