@Before
  public void prepareFixture() throws Exception {
    Class<AbstractNodeIteratingGraphTraverser> traverserClass =
        AbstractNodeIteratingGraphTraverser.class;
    traverser =
        createMock(
            traverserClass,
            traverserClass.getMethod("hasNext", (Class[]) null),
            traverserClass.getMethod("next", (Class[]) null),
            traverserClass.getDeclaredMethod("enqueueNodes", Collection.class));

    // creating the mock doesn't initialize instance fields, for some reason
    ReflectionUtils.setValue(
        traverser, "nodeVisitors", new ArrayList<NodeVisitor<Object, StringBuilder>>());
    ReflectionUtils.setValue(traverser, "visitedOrQueuedNodes", new HashSet<Object>());
  }
  @Test
  public void addNode_node_seen() throws IllegalAccessException {
    ReflectionUtils.setValue(traverser, "visitedOrQueuedNodes", SetUtils.asSet(1));

    // expect no calls to enqueue
    traverser.addNode(1);
  }
  @Test
  public void addNode_nodes_seen() throws IllegalAccessException {
    ReflectionUtils.setValue(traverser, "visitedOrQueuedNodes", SetUtils.asSet(1));

    traverser.enqueueNodes(colEq(Arrays.asList(2)));
    expectLastCall();
    replay(traverser);

    traverser.addNode(Arrays.asList(1, 2));

    verify(traverser);
  }