### Question:
Page { public Page getRegion(int positionOffset, int length) { if (positionOffset < 0 || length < 0 || positionOffset + length > positionCount) { throw new IndexOutOfBoundsException(format("Invalid position %s and length %s in page with %s positions", positionOffset, length, positionCount)); } int channelCount = getChannelCount(); Block[] slicedBlocks = new Block[channelCount]; for (int i = 0; i < channelCount; i++) { slicedBlocks[i] = blocks[i].getRegion(positionOffset, length); } return wrapBlocksWithoutCopy(length, slicedBlocks); } Page(Block... blocks);  Page(int positionCount, Block... blocks); private  Page(boolean blocksCopyRequired, int positionCount, Block[] blocks); int getChannelCount(); int getPositionCount(); long getSizeInBytes(); long getLogicalSizeInBytes(); long getRetainedSizeInBytes(); Block getBlock(int channel); Page getSingleValuePage(int position); Page getRegion(int positionOffset, int length); Page appendColumn(Block block); void compact(); Page getLoadedPage(); @Override String toString(); Page getPositions(int[] retainedPositions, int offset, int length); Page copyPositions(int[] retainedPositions, int offset, int length); Page getColumns(int column); Page getColumns(int... columns); Page prependColumn(Block column); static final int INSTANCE_SIZE; }### Answer:
@Test public void testGetRegion() { assertEquals(new Page(10).getRegion(5, 5).getPositionCount(), 5); }
@Test(expectedExceptions = IndexOutOfBoundsException.class, expectedExceptionsMessageRegExp = "Invalid position 1 and length 1 in page with 0 positions") public void testGetRegionExceptions() { new Page(0).getRegion(1, 1); }