public static GapEncodedVariableLengthIntegerReader combine(GapEncodedVariableLengthIntegerReader reader1, GapEncodedVariableLengthIntegerReader reader2, ArraySegmentRecycler memoryRecycler) {
        reader1.reset();
        reader2.reset();
        ByteDataArray arr = new ByteDataArray(memoryRecycler);
        int cur = 0;

        while(reader1.nextElement() != Integer.MAX_VALUE || reader2.nextElement() != Integer.MAX_VALUE) {
            if(reader1.nextElement() < reader2.nextElement()) {
                VarInt.writeVInt(arr, reader1.nextElement() - cur);
                cur = reader1.nextElement();
                reader1.advance();
            } else if(reader2.nextElement() < reader1.nextElement()) {
                VarInt.writeVInt(arr, reader2.nextElement() - cur);
                cur = reader2.nextElement();
                reader2.advance();
            } else {
                VarInt.writeVInt(arr, reader1.nextElement() - cur);
                cur = reader1.nextElement();
                reader1.advance();
                reader2.advance();
            }
        }

        return new GapEncodedVariableLengthIntegerReader(arr.getUnderlyingArray(), (int)arr.length());
    }
@Test
    public void testCombine() {
        GapEncodedVariableLengthIntegerReader reader1 = reader(1, 10, 100, 105, 107, 200);
        GapEncodedVariableLengthIntegerReader reader2 = reader(5, 76, 100, 102, 109, 197, 198, 199, 200, 201);

        GapEncodedVariableLengthIntegerReader combined = GapEncodedVariableLengthIntegerReader.combine(reader1, reader2, WastefulRecycler.SMALL_ARRAY_RECYCLER);

        assertValues(combined, 1, 5, 10, 76, 100, 102, 105, 107, 109, 197, 198, 199, 200, 201);
    }