BlockEncoding blockEncoding = new RunLengthEncoder(sliceOutput).append(tuples).finish();
SliceInput sliceInput = sliceOutput.slice().getInput();
Block block = blockEncoding.readBlock(sliceInput);
assertInstanceOf(block, RunLengthEncodedBlock.class);
RunLengthEncodedBlock rleBlock = (RunLengthEncodedBlock) block;
assertEquals(rleBlock.getSingleValue(), createTuple("alice"));
assertEquals(rleBlock.getPositionCount(), 2);
block = blockEncoding.readBlock(sliceInput);
assertInstanceOf(block, RunLengthEncodedBlock.class);
rleBlock = (RunLengthEncodedBlock) block;
assertEquals(rleBlock.getSingleValue(), createTuple("bob"));
assertEquals(rleBlock.getPositionCount(), 4);
block = blockEncoding.readBlock(sliceInput);
assertInstanceOf(block, RunLengthEncodedBlock.class);
rleBlock = (RunLengthEncodedBlock) block;
assertEquals(rleBlock.getSingleValue(), createTuple("charlie"));
assertEquals(rleBlock.getPositionCount(), 6);
assertFalse(sliceInput.isReadable());
}