public synchronized boolean isLocked(){
  return (lock != null && !lock.isShared());
}

public synchronized boolean isLocked ( ) { return ( lock != null && ! lock . isShared ( ) ) ; }
return true if the write lock is currently acquired exclusively .
