public void testConcurrentMoveToSameDest() throws Exception {
// tests a tree structure as such:
// /a/x, /b/y, /c
// N threads try to move /a/x to /c and /b/y to /c at the same time
final int N = 5;
final Fqn X = Fqn.fromString("/x"), Y = Fqn.fromString("/y");
// set up the initial structure.
Node<Object, Object> rootNode = treeCache.getRoot();
Node<Object, Object> nodeA = rootNode.addChild(A);
nodeA.addChild(X);
Node<Object, Object> nodeB = rootNode.addChild(B);
nodeB.addChild(Y);
Node<Object, Object> nodeC = rootNode.addChild(C);
Callable<Object>[] movers = new Callable[N];
for (int i = 0; i < N; i++) {
final Fqn source = i % 2 == 0 ? Fqn.fromRelativeFqn(A, X) : Fqn.fromRelativeFqn(B, Y);
movers[i] = new Callable<Object>() {
public Object call() throws Exception {
try {
treeCache.move(source, C);
} catch (Exception e) {