@Test
public void buildQueueWithChildren() {

  createChildren();
  Queue<AccessibilityNodeInfoSorter> queue = testSubject.buildPriorityQueue(rootNode);
  Long rootOrder = Long.MAX_VALUE;
  Long childOrder = rootOrder - 1;
  Long grandchildOrder = rootOrder - 2;
  verifyAllNodesCreated(rootOrder, childOrder, childOrder, grandchildOrder);
  Assert.assertEquals(queue.size(), 4);
  assertNextQueueItemEquals(queue, grandchildNode, grandchildOrder);
  // Since the child nodes have the same priority, they can appear here in any order,
  // so check for both ordering possibilities
  if (queue.peek().node == childNode0) {
    assertNextQueueItemEquals(queue, childNode0, childOrder);
    assertNextQueueItemEquals(queue, childNode1, childOrder);
  } else {
    assertNextQueueItemEquals(queue, childNode1, childOrder);
    assertNextQueueItemEquals(queue, childNode0, childOrder);
  }
  assertNextQueueItemEquals(queue, rootNode, rootOrder);
}