@Test
  public void testBucketIdRollOver() {
    for (int i = 0; i < 16384; i++) {
      int encode = BucketCodec.getCodec(1).encode(new AcidOutputFormat
              .Options(null)
              .bucket(i)
              .statementId(10)
              .maxStmtId(0b001000000000)); // 2 bit free
      assertEquals(i % 4096, BucketCodec.getCodec(1).decodeWriterId(encode));
      if (i < 4096)
        assertEquals(10, BucketCodec.getCodec(1).decodeStatementId(encode));
      else if (i < 8192)
        assertEquals(0b010000001010, BucketCodec.getCodec(1).decodeStatementId(encode));
      else if (i < 12288)
        assertEquals(0b100000001010, BucketCodec.getCodec(1).decodeStatementId(encode));
      else
        assertEquals(0b110000001010, BucketCodec.getCodec(1).decodeStatementId(encode));
    }
  }
Test Bucket Codec version 1. Represents format of "bucket" property in Hive
3.0.
ql/src/test/org/apache/hadoop/hive/ql/io/TestBucketCodec.java