public Page dropColumn(int channelIndex)
    {
        if (channelIndex < 0 || channelIndex >= getChannelCount()) {
            throw new IndexOutOfBoundsException(format("Invalid channel %d in page with %s channels", channelIndex, getChannelCount()));
        }

        Block[] result = new Block[getChannelCount() - 1];
        System.arraycopy(blocks, 0, result, 0, channelIndex);
        System.arraycopy(blocks, channelIndex + 1, result, channelIndex, getChannelCount() - channelIndex - 1);
        return wrapBlocksWithoutCopy(positionCount, result);
    }
@Test
    public void testDropColumn()
    {
        int entries = 10;
        BlockBuilder blockBuilder = BIGINT.createBlockBuilder(null, entries);
        for (int i = 0; i < entries; i++) {
            BIGINT.writeLong(blockBuilder, i);
        }
        Block block = blockBuilder.build();

        Page page = new Page(block, block, block);
        assertEquals(page.getChannelCount(), 3);
        Page newPage = page.dropColumn(1);
        assertEquals(page.getChannelCount(), 3, "Page was modified");
        assertEquals(newPage.getChannelCount(), 2);

        assertEquals(newPage.getBlock(0).getLong(0), 0);
        assertEquals(newPage.getBlock(1).getLong(1), 1);
    }