protected final void resize(int requiredSize){
  int newCapacity=((queue.length < 64) ? ((queue.length + 1) << 1) : ((queue.length >> 1) * 3));
  if (newCapacity < 0) {
    throw new OutOfMemoryError();
  }
  if (requiredSize > newCapacity) {
    newCapacity=requiredSize;
  }
  queue=Arrays.copyOf(queue,newCapacity);
}

protected final void resize ( int requiredSize ) { int newCapacity = ( ( queue . length < 64 ) ? ( ( queue . length + 1 ) << 1 ) : ( ( queue . length > > 1 ) * 3 ) ) ; if ( newCapacity < 0 ) { throw new OutOfMemoryError ( ) ; } if ( requiredSize > newCapacity ) { newCapacity = requiredSize ; } queue = Arrays . copyOf ( queue , newCapacity ) ; }
test whether we need to resize to have the requested capacity .
