public boolean isGranted(T tx){
  if (tx == null) {
    throw new NullPointerException();
  }
  return queue.peek() == tx;
}

public boolean isGranted ( T tx ) { if ( tx == null ) { throw new NullPointerException ( ) ; } return queue . peek ( ) == tx ; }
return true if the transaction currently holds the lock .
