@Test
public void shouldReturnIteratorOfChildren() {

    parent = new AstNode("parent");
    AstNode child1 = new AstNode(parent, "childA");
    AstNode child2 = new AstNode(parent, "childB");
    AstNode child3 = new AstNode(parent, "childC");
    Iterator<AstNode> children = parent.iterator();
    assertThat(children.next(), is(sameInstance(child1)));
    assertThat(children.next(), is(sameInstance(child2)));
    assertThat(children.next(), is(sameInstance(child3)));
    assertThat(children.hasNext(), is(false));
}