@@ -0,0 +1,2831 @@
+/*%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage io.prestosql.spi.block;%0A%0Aimport io.airlift.slice.DynamicSliceOutput;%0Aimport io.prestosql.spi.type.Type;%0Aimport org.testng.annotations.Test;%0A%0Aimport static io.prestosql.spi.block.TestingSession.SESSION;%0Aimport static io.prestosql.spi.type.BigintType.BIGINT;%0Aimport static org.testng.Assert.assertEquals;%0A%0Apublic class TestLongArrayBlockEncoding%0A%7B%0A    private final BlockEncodingSerde blockEncodingSerde = new TestingBlockEncodingSerde();%0A%0A    @Test%0A    public void testRoundTripNoNull()%0A    %7B%0A        BlockBuilder expectedBlockBuilder = BIGINT.createBlockBuilder(null, 4);%0A        BIGINT.writeLong(expectedBlockBuilder, 1);%0A        BIGINT.writeLong(expectedBlockBuilder, 2);%0A        BIGINT.writeLong(expectedBlockBuilder, 3);%0A        BIGINT.writeLong(expectedBlockBuilder, 4);%0A        Block expectedBlock = expectedBlockBuilder.build();%0A%0A        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);%0A        blockEncodingSerde.writeBlock(sliceOutput, expectedBlock);%0A        Block actualBlock = blockEncodingSerde.readBlock(sliceOutput.slice().getInput());%0A        assertBlockEquals(BIGINT, actualBlock, expectedBlock);%0A    %7D%0A%0A    @Test%0A    public void testRoundTripWithNull()%0A    %7B%0A        BlockBuilder expectedBlockBuilder = BIGINT.createBlockBuilder(null, 7);%0A        expectedBlockBuilder.appendNull();%0A        expectedBlockBuilder.appendNull();%0A        BIGINT.writeLong(expectedBlockBuilder, 1);%0A        expectedBlockBuilder.appendNull();%0A        BIGINT.writeLong(expectedBlockBuilder, 3);%0A        expectedBlockBuilder.appendNull();%0A        expectedBlockBuilder.appendNull();%0A        Block expectedBlock = expectedBlockBuilder.build();%0A%0A        DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);%0A        blockEncodingSerde.writeBlock(sliceOutput, expectedBlock);%0A        Block actualBlock = blockEncodingSerde.readBlock(sliceOutput.slice().getInput());%0A        assertBlockEquals(BIGINT, actualBlock, expectedBlock);%0A    %7D%0A%0A    private static void assertBlockEquals(Type type, Block actual, Block expected)%0A    %7B%0A        for (int position = 0; position %3C actual.getPositionCount(); position++) %7B%0A            assertEquals(type.getObjectValue(SESSION, actual, position), type.getObjectValue(SESSION, expected, position));%0A        %7D%0A    %7D%0A%7D%0A

Add TestLongArrayBlockEncoding