BatchEventBroker { @Schedule(second="*/5",minute="*",hour="*") public void sendEventBatch() { for (BrowserWindow browserWindow : browsers) { try { if(events.isEmpty()){ browserWindow.nothingToSay(); }else{ for (String event : events) { browserWindow.send(event); } } } finally { browserWindow.commit(); browsers.remove(browserWindow); } } events.clear(); }  void onBrowserRequest(@Observes BrowserWindow browserWindow); void onNewEvent(@Observes String message); @Schedule(second="*/5",minute="*",hour="*") void sendEventBatch();  }
@Test public void sendBatch(){ cut.sendEventBatch(); }