private void expectStart(final List<ConsumerRecord<byte[], byte[]>> preexistingRecords) throws Exception { storeLog.start(); PowerMock.expectLastCall() .andAnswer( new IAnswer<Object>() { @Override public Object answer() throws Throwable { for (ConsumerRecord<byte[], byte[]> rec : preexistingRecords) capturedConsumedCallback.getValue().onCompletion(null, rec); return null; } }); }