public T removeFirst ( ) { try { modifyLock . lock ( ) ; Iterator < T > it = iterator ( ) ; if ( it . hasNext ( ) ) { T item = it . next ( ) ; it . remove ( ) ; return item ; } } finally { modifyLock . unlock ( ) ; } return null ; }
Special method that removes head element .