private void checkInvariants() {
	assert elements[tail] == null;
	assert head == tail ? elements[head] == null :
	    (elements[head] != null &&
	     elements[(tail - 1) & (elements.length - 1)] != null);
	assert elements[(head - 1) & (elements.length - 1)] == null;
    }