@Test
  @Repeating(repetition = 10)
  public void testNullsInSubset() {
    prepareNullIndices();
    BitSet nulls = new BitSet(NUM_VARS);
    for (int index : nullIndices) {
      nulls.set(index);
    }

    ColumnBuffer columnBuffer = new ColumnBuffer(type, nulls, vars);
    Random random = ThreadLocalRandom.current();

    int remaining = NUM_VARS;
    while (remaining > 0) {
      int toExtract = random.nextInt(remaining) + 1;
      ColumnBuffer subset = columnBuffer.extractSubset(toExtract);
      verifyNulls(subset, NUM_VARS - remaining);
      remaining -= toExtract;
    }
  }
Test if the nulls BitSet is maintained properly when we extract subset from ColumnBuffer.
E.g. suppose we have a ColumnBuffer with nulls [0, 0, 1, 0]. When we split it evenly into
two subsets, the subsets should have nulls [0, 0] and [1, 0] respectively.
serde/src/test/org/apache/hadoop/hive/serde2/thrift/TestColumnBuffer.java