public Lock acquireLock(K key){
  if (key == null) {
    throw new NullPointerException("Key must not be null");
  }
  final Key<K> internalKey=new Key<K>(key);
  Lock lock;
synchronized (lockCache) {
    final Reference<Lock> holder=lockCache.get(internalKey);
    if (holder == null || (lock=holder.get()) == null) {
      lock=new KeyReferenceLock<K>(internalKey);
      lockCache.put(internalKey,new WeakReference<Lock>(lock));
    }
  }
  return lock;
}

public Lock acquireLock ( K key ) { if ( key == null ) { throw new NullPointerException ( "Key must not be null" ) ; } final Key < K > internalKey = new Key < K > ( key ) ; Lock lock ; synchronized ( lockCache ) { final Reference < Lock > holder = lockCache . get ( internalKey ) ; if ( holder == null || ( lock = holder . get ( ) ) == null ) { lock = new KeyReferenceLock < K > ( internalKey ) ; lockCache . put ( internalKey , new WeakReference < Lock > ( lock ) ) ; } } return lock ; }
given a key , lookup / create the associated lock instance .
