BufferingLogDataCollectorProxy implements LogDataCollector, Stoppable { @Override public synchronized LogData[] getLogData() { return proxyLogDataCollector.getLogData(); } BufferingLogDataCollectorProxy(LogDataCollector delegate, final long sleepTime, Configuration configuration); @Override synchronized void add(LogData... logDatas); @Override synchronized LogData[] getLogData(); @Override int getCount(); @Override void stop(); @Override int clear();  }
@Test public void testGetLogData() { LogData data1 = new LogData(); data1.setId(1); LogData data2 = new LogData(); data2.setId(2); AssertJUnit.assertEquals(0, delegate.getLogData().length); bufferingLogDataCollectorProxy.add(data1); bufferingLogDataCollectorProxy.add(data2); LogData[] logData = bufferingLogDataCollectorProxy.getLogData(); AssertJUnit.assertEquals(2, logData.length); AssertJUnit.assertArrayEquals(new LogData[] { data1, data2 }, logData); }