TimingBloomFilter extends TimerTask { public void decay() { run(); } TimingBloomFilter(int capacity, int decayTime);  TimingBloomFilter(int capacity, int decayTime, double error); void startDecay(); void decay(); @Override void run(); void add(Object key); void add(Object key, long timestamp); boolean membershipTest(Object key); double getError();  }
@Test @Ignore public void testDecay() throws InterruptedException { TimingBloomFilter filter = new TimingBloomFilter(500, 4); filter.startDecay(); filter.add("hello"); assertTrue(filter.membershipTest("hello")); Thread.sleep(5 * 1000); assertFalse(filter.membershipTest("hello")); }