CountingBloomFilterBasedWindow { public List<ComplexEvent> find(String attributeName, Object value) { List<ComplexEvent> foundEventList = new ArrayList<ComplexEvent>(); Key key = new Key(value.toString().getBytes()); if (filter.membershipTest(key)) { Iterator<StreamEvent> iterator = eventQueue.iterator(); while (iterator.hasNext()) { StreamEvent streamEvent = (StreamEvent) iterator.next(); if (streamEvent.getAttribute(joinAttributeId).equals(value)) { foundEventList.add(streamEvent); } } } return foundEventList; }  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 testWithStateEvent() { StreamEvent[] streamEvents1 = { createStreamEvent("Hp", 210.45, 23), createStreamEvent("Apple", 3500.50, 10), createStreamEvent("Dell", 245.95, 78) }; Assert.assertTrue(window.find("price", 1000.55).isEmpty()); Assert.assertFalse(window.find("price", 3500.50).isEmpty()); StreamEvent[] streamEvents2 = { createStreamEvent("Toshiba", 234.45, 24), createStreamEvent("Dell", 456.45, 80), createStreamEvent("Hp", 875.98, 70), createStreamEvent("Hp", 223.87, 190), createStreamEvent("Apple", 356.97, 76) }; Assert.assertFalse(window.find("price", 3500.50).isEmpty()); StreamEvent[] streamEvents3 = { createStreamEvent("Hp", 678.87, 65), createStreamEvent("Toshiba", 235.95, 19), createStreamEvent("Dell", 879.25, 57), createStreamEvent("Hp", 345.45, 19), createStreamEvent("Hp", 879.76, 86), createStreamEvent("Apple", 719.82, 29), createStreamEvent("Hp", 985.30, 112) }; Assert.assertTrue(window.find("price", 3500.50).isEmpty()); }