@Test public void pollOnEmptyQueueShouldReturnNull() { Queue<Integer> queue = new FixedArrayQueue<>(5); assertNull(queue.peek()); }
@Override public E peek() { return buffer[(int) head & mask]; }
FixedArrayQueue implements Queue<E> { @Override public E peek() { return buffer[(int) head & mask]; } }
FixedArrayQueue implements Queue<E> { @Override public E peek() { return buffer[(int) head & mask]; } @SuppressWarnings("unchecked")  FixedArrayQueue(final int capacity); }
FixedArrayQueue implements Queue<E> { @Override public E peek() { return buffer[(int) head & mask]; } @SuppressWarnings("unchecked")  FixedArrayQueue(final int capacity); static int findNextPositivePowerOfTwo(final int size); @Override boolean add(final E e); @Override boolean offer(final E e); @Override E poll(); @Override E remove(); @Override E element(); @Override E peek(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(final Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(final T[] a); @Override boolean remove(final Object o); @Override boolean containsAll(final Collection<?> c); @Override boolean addAll(final Collection<? extends E> c); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); @Override void clear(); }
FixedArrayQueue implements Queue<E> { @Override public E peek() { return buffer[(int) head & mask]; } @SuppressWarnings("unchecked")  FixedArrayQueue(final int capacity); static int findNextPositivePowerOfTwo(final int size); @Override boolean add(final E e); @Override boolean offer(final E e); @Override E poll(); @Override E remove(); @Override E element(); @Override E peek(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(final Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @Override T[] toArray(final T[] a); @Override boolean remove(final Object o); @Override boolean containsAll(final Collection<?> c); @Override boolean addAll(final Collection<? extends E> c); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); @Override void clear();  }