public RelationshipView add(@Nonnull Element source, String description, @Nonnull Element destination) { if (source == null) { throw new IllegalArgumentException("A source element must be specified."); } if (destination == null) { throw new IllegalArgumentException("A destination element must be specified."); } checkElement(source); checkElement(destination); // check that the relationship is in the model before adding it Relationship relationship = source.getEfferentRelationshipWith(destination); if (relationship != null) { addElement(source, false); addElement(destination, false); return addRelationship(relationship, description, sequenceNumber.getNext()); } else { throw new IllegalArgumentException("A relationship between " + source.getName() + " and " + destination.getName() + " does not exist in model."); } }