### Question:
Decision extends NodeBase { @Override public void removeParent(final NodeBase parent) { Preconditions.checkArgument(this.parent == parent, "Trying to remove a nonexistent parent."); if (this.parent != null) { this.parent.removeChild(this); } this.parent = null; } Decision(final String name); NodeBase getParent(); @Override void addParent(final NodeBase parent); @Override void addParentWithCondition(final Decision parent, final Condition condition); @Override void addParentDefaultConditional(final Decision parent); @Override void removeParent(final NodeBase parent); @Override void clearParents(); @Override List<NodeBase> getChildren(); List<DagNodeWithCondition> getChildrenWithConditions(); NodeBase getDefaultChild();  }### Answer:
@Test public void testRemoveNonexistentParentThrows() { final Start parent = new Start("parent"); final Decision instance = getInstance("instance"); expectedException.expect(IllegalArgumentException.class); instance.removeParent(parent); }