public synchronized boolean removeFirst(K obj){
  if (peekFirst() != obj) {
    return false;
  }
  int len=array.length;
  @SuppressWarnings("unchecked") K[] a=(K[])new Object[len - 1];
  System.arraycopy(array,1,a,0,len - 1);
  array=a;
  return true;
}

public synchronized boolean removeFirst ( K obj ) { if ( peekFirst ( ) != obj ) { return false ; } int len = array . length ; @ SuppressWarnings ( "unchecked" ) K [ ] a = ( K [ ] ) new Object [ len - 1 ] ; System . arraycopy ( array , 1 , a , 0 , len - 1 ) ; array = a ; return true ; }
remove the first element , if it matches .
