boolean sessionScoped = false;
Lock l = lockMgr.lock(testPath, true, sessionScoped, Long.MAX_VALUE, null);
String ltoken = l.getLockToken();
Session other = helper.getReadWriteSession();
LockManager otherLockMgr = getLockManager(other);
try {
lockMgr.removeLockToken(ltoken);
otherLockMgr.addLockToken(ltoken);
assertTrue("The new holding manager must contain the token.", containsLockToken(otherLockMgr, ltoken));
Lock otherL = otherLockMgr.getLock(testPath);
assertNotNull("Token must be exposed to new lock holder.", otherL.getLockToken());
assertEquals("Token must be the same again.", ltoken, otherL.getLockToken());
} finally {
otherLockMgr.removeLockToken(ltoken);
lockMgr.addLockToken(ltoken);
other.logout();
}
}