@Test
public void testDeadlockOf3() throws Exception
{

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