### Question:
JoiningNodeBase extends NodeBase { @Override public void removeParent(final NodeBase parent) { Preconditions.checkArgument(parents.remove(parent), "Trying to remove a nonexistent parent"); parent.removeChild(this); } JoiningNodeBase(final String name, final T branching); List<NodeBase> getParents(); @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(); NodeBase getChild();  }### Answer:
@Test public void testRemoveNonexistentParentThrows() { final ExplicitNode parent = new ExplicitNode("parent", null); final J instance = getJoiningInstance("instance"); expectedException.expect(IllegalArgumentException.class); instance.removeParent(parent); }