@Test
public void testQueueReferencePrecedence() throws IOException {

  CSQueueStore store = new CSQueueStore();
  //root.main.a.b
  //root.second.a.d.b.c
  // a - ambiguous both instances are parent queues
  // b - leaf queue b takes precedence over parent queue b
  //root.main
  CSQueue main = createParentQueue("main", root);
  //root.main.A
  CSQueue mainA = createParentQueue("A", main);
  //root.main.A.B
  CSQueue mainAB = createLeafQueue("B", mainA);
  //root.second
  CSQueue second = createParentQueue("second", root);
  //root.second.A
  CSQueue secondA = createParentQueue("A", second);
  //root.second.A.B
  CSQueue secondAD = createParentQueue("D", secondA);
  //root.second.A.B.D
  CSQueue secondADB = createParentQueue("B", secondAD);
  //root.second.A.B.D.C
  CSQueue secondADBC = createLeafQueue("C", secondADB);
  store.add(main);
  store.add(mainA);
  store.add(mainAB);
  store.add(second);
  store.add(secondA);
  store.add(secondAD);
  store.add(secondADB);
  store.add(secondADBC);
  assertAccessibleByAllNames(store, main);
  assertAccessibleByAllNames(store, second);
  assertAmbiguous(store, mainA);
  assertAmbiguous(store, secondA);
  assertAmbiguous(store, mainAB);
  assertAccessibleByAllNames(store, secondAD);
  assertAmbiguous(store, secondADB);
  assertAccessibleByAllNames(store, secondADBC);
}