CountingBloomFilterBasedWindow { public ComplexEvent getLast(Boolean remove) { if (remove) { StreamEvent streamEvent = eventQueue.poll(); filter.delete(new Key((byte[]) streamEvent.getAttribute(joinAttributeId).toString() .getBytes())); return streamEvent; } else { return eventQueue.peek(); } }  void init(Expression[] expressions); void add(ComplexEvent event); ComplexEvent getLast(Boolean remove); List<ComplexEvent> find(String attributeName, Object value); void remove(ComplexEvent event); Object[] currentState(); void restoreState(Object[] objects); int size(); void destroy();  }
@Test public void testGetLast() { StreamEvent event = createStreamEvent("Dell", 245.95, 78); addStreamEvent(event); addStreamEvent(createStreamEvent("Hp", 210.45, 23)); addStreamEvent(createStreamEvent("Apple", 3500.50, 10)); Assert.assertEquals(event, (StreamEvent) window.getLast(false)); Assert.assertEquals(event, (StreamEvent) window.getLast(true)); Assert.assertNotSame(event, (StreamEvent) window.getLast(false)); }