public void unlock(K key){
  ReentrantLock lock=getLock(key);
  if (!lock.isHeldByCurrentThread()) {
    throw new IllegalStateException("Cannot release lock not held by current thread: " + key);
  }
  lock.unlock();
}

public void unlock ( K key ) { ReentrantLock lock = getLock ( key ) ; if ( ! lock . isHeldByCurrentThread ( ) ) { throw new IllegalStateException ( "Cannot release lock not held by current thread: " + key ) ; } lock . unlock ( ) ; }
unlocks the given key
