private static int getPackedCapacity(int capacity) {
      if (capacity < MIN_CAPACITY || capacity > MAX_CAPACITY) {
        throw new IllegalArgumentException(
          "PaddingRecord capacity(" + capacity + ") must be in [" + MIN_CAPACITY + ".." + MAX_CAPACITY + "]");
      }
      final int capacityOverFirstBucket = capacity - MIN_CAPACITY;
      if ((capacityOverFirstBucket % OFFSET_BUCKET) != 0) {
        throw new IllegalArgumentException("capacity-MIN (=" + capacityOverFirstBucket + ") must be rounded up to " + OFFSET_BUCKET);
      }

      return capacityOverFirstBucket >> OFFSET_BUCKET_BITS;
    }
private static int getPackedCapacity(int capacity)