OrderedReadyNodes { public Node pop() { return nodes.poll(); }  void add(Node node); Node pop(); boolean isEmpty();  }
@Test public void require_NameProviders_before_SearcherNodes() { NameProvider nameProvider = createDummyNameProvider(100); ComponentNode componentNode = new ComponentNode<>(createFakeComponentA("a"), 1); addNodes(nameProvider, componentNode); assertEquals(nameProvider, pop()); assertEquals(componentNode, pop()); }
@Test public void require_SearcherNodes_ordered_by_insertion_order() { int priority = 0; ComponentNode a = new ComponentNode<>(createFakeComponentB("1"), priority++); ComponentNode b = new ComponentNode<>(createFakeComponentA("2"), priority++); ComponentNode c = new ComponentNode<>(createFakeComponentA("03"), priority++); addNodes(a, b, c); assertEquals(a, pop()); assertEquals(b, pop()); assertEquals(c, pop()); }