### Question:
PageUtils { public static void recordMaterializedBytes(Page page, LongConsumer sizeInBytesConsumer) { long loadedBlocksSizeInBytes = 0; for (int i = 0; i < page.getChannelCount(); ++i) { Block block = page.getBlock(i); long initialSize = block.getSizeInBytes(); loadedBlocksSizeInBytes += initialSize; listenForLoads(block, new BlockSizeListener(block, sizeInBytesConsumer, initialSize)); } if (loadedBlocksSizeInBytes > 0) { sizeInBytesConsumer.accept(loadedBlocksSizeInBytes); } } private  PageUtils(); static void recordMaterializedBytes(Page page, LongConsumer sizeInBytesConsumer);  }### Answer:
@Test public void testRecordMaterializedBytes() { Block first = createIntsBlock(1, 2, 3); LazyBlock second = lazyWrapper(first); LazyBlock third = lazyWrapper(first); Page page = new Page(3, first, second, third); second.getLoadedBlock(); AtomicLong sizeInBytes = new AtomicLong(); recordMaterializedBytes(page, sizeInBytes::getAndAdd); assertEquals(sizeInBytes.get(), first.getSizeInBytes() * 2); page.getBlock(2).getLoadedBlock(); assertEquals(sizeInBytes.get(), first.getSizeInBytes() * 3); }