public boolean offer(E item) {
        checkNotNull(item, "item");

        if (tail - head + 1 == capacity) {
            return false;
        } else {
            long t = tail + 1;
            int index = (int) (t & mask);
            array[index] = item;
            tail = t;
            return true;
        }
    }
@Test(expected = NullPointerException.class)
    public void test_offer_whenNull() {
        CircularQueue<Integer> queue = new CircularQueue<>(128);
        queue.offer(null);
    }