### Question:
Start extends NodeBase { @Override public void addParent(final NodeBase parent) { throw new IllegalStateException("Start nodes cannot have parents."); } Start(final String name); NodeBase getChild(); @Override void addParent(final NodeBase parent); @Override void addParentWithCondition(final Decision parent, final Condition condition); @Override void addParentDefaultConditional(Decision parent); @Override void removeParent(NodeBase parent); @Override void clearParents(); @Override List<NodeBase> getChildren();  }### Answer:
@Test public void testAddParent() { final ExplicitNode parent = new ExplicitNode("parent", null); final Start start = getInstance("start"); expectedException.expect(IllegalStateException.class); start.addParent(parent); }
@Test public void testStartAddedAsParentWhenItAlreadyHasAChildThrows() { final Start start = getInstance("start"); final NodeBase child1 = new ExplicitNode("child1", null); final NodeBase child2 = new ExplicitNode("child2", null); child1.addParent(start); expectedException.expect(IllegalStateException.class); child2.addParent(start); }