FirstLevelStream implements IViewable { public final void add(IEvent theEvent) { IEvent[] newData = new IEvent[] {theEvent}; for (IView childView : children) { childView.update(newData, null); } lastInsertedEvent = theEvent; }  final void add(IEvent theEvent); final IView addView(IView view); final List<IView> getViews(); final boolean removeView(IView view); final boolean hasViews(); void removeAllViews(); @Override void start(); @Override void stop(); final IEvent getLastInsertedEvent();  }
@Test public void testAdd() { Map<String, Object> values = new HashMap<String, Object>(); values.put("a", 1); values.put("b", 1); values.put("c", "c1"); IEvent event1 = new TupleEvent("stream", eventType, values); childView.clearLastNewData(); stream.add(event1); assertTrue(childView.getLastNewData() != null); assertEquals(1, childView.getLastNewData().length); assertEquals(event1, childView.getLastNewData()[0]); childView.clearLastNewData(); stream.removeView(childView); stream.add(event1); assertTrue(childView.getLastNewData() == null); }