}
if (child == null) {
throw new NullPointerException("No null child accepted");
}
if (child == this) {
throw new CycleDetectionException(Arrays.asList(this));
}
LinkedList<MetaModelObject> path = child.findPath(this);
if (path != null) {
path.addLast(this);
throw new CycleDetectionException(path);
}
else {
if (child.parents.containsKey(this)) {
throw new IllegalArgumentException("Child " + child + " cannot be added for key " + key + " because parent already contains it");
} else {