private static int serializedSize(List<? extends Type> types, Page expectedPage)
{
DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
writePages(createTestingBlockEncodingManager(), sliceOutput, expectedPage);
Slice slice = sliceOutput.slice();
Iterator<Page> pageIterator = readPages(createTestingBlockEncodingManager(), slice.getInput());
if (pageIterator.hasNext()) {
assertPageEquals(types, pageIterator.next(), expectedPage);
}
else {
assertEquals(expectedPage.getPositionCount(), 0);
}
assertFalse(pageIterator.hasNext());
return slice.length();
}