@Test
public void testDeadlockOf2() throws Exception
{

    TestKey k0 = key(0);
    TestKey k1 = key(1);
    a.lock(k0);
    b.lock(k1);
    a.lock(k1);
    b.lock(k0);
    DeadlockDetector deadlockDetector = new DeadlockDetector(lockManager);
    Set<Transaction> victims = deadlockDetector.victims();
    assertEquals(1, victims.size());
    assertEquals(latestStart(a, b).transaction(), victims.iterator().next());
}