(#8040) Do not create duplicate edges

If a class is contained twice in the same location, this is consistent but
should only create one edge.
(#8040) Clarify behavior in tests around multiple containment