void pushId(int id) {
        int bucketIdx = id / BUCKET_SIZE;
        if (bucketIdx >= idBuckets.length) {
            throw new IllegalArgumentException("id too large: " + id);
        }
        DnsQueryIdRange bucket = idBuckets[bucketIdx];
        assert bucket != null;
        bucket.pushId(id);

        if (bucket.usableIds() == bucket.maxUsableIds()) {
            // All ids are usable in this bucket. Let's check if there are other buckets left that have still
            // some space left and if so drop this bucket.
            for (int idx = 0; idx < idBuckets.length; idx++) {
                if (idx != bucketIdx) {
                    DnsQueryIdRange otherBucket = idBuckets[idx];
                    if (otherBucket != null && otherBucket.usableIds() > BUCKET_DROP_THRESHOLD) {
                        // Drop bucket on the floor to reduce memory usage, there is another bucket left we can
                        // use that still has enough ids to use.
                        idBuckets[bucketIdx] = null;
                        return;
                    }
                }
            }
        }
    }
@Test
    public void testOverflow() {
        final DnsQueryIdSpace ids = new DnsQueryIdSpace();
        assertThrows(IllegalStateException.class, new Executable() {
            @Override
            public void execute() {
                ids.pushId(1);
            }
        });
    }