private void assertBufferResultEquals(BufferResult actual, BufferResult expected)
{
assertEquals(actual.getElements().size(), expected.getElements().size());
assertEquals(actual.getStartingSequenceId(), expected.getStartingSequenceId());
for (int i = 0; i < actual.getElements().size(); i++) {
Page actualPage = actual.getElements().get(i);
Page expectedPage = expected.getElements().get(i);
assertEquals(actualPage.getChannelCount(), expectedPage.getChannelCount());
for (int channel = 0; channel < actualPage.getChannelCount(); channel++) {
assertBlockEquals(actualPage.getBlock(channel), expectedPage.getBlock(channel));
}
}
assertEquals(actual.isBufferClosed(), expected.isBufferClosed());
}