+ Collection<Resource> flagDiagrams = OrderedSetUtils.getOwnerLists(graph, r, DIA.Diagram);\r
+ for (Resource counterpart : counterparts) {\r
+ boolean joinedWithinSingleDiagram = !Collections.disjoint(flagDiagrams,\r
+ OrderedSetUtils.getOwnerLists(graph, counterpart, DIA.Diagram));\r
+ if (!joinedWithinSingleDiagram)\r
+ return Collections.emptyList();\r
+ if (!isConnectedToSomething(graph, counterpart))\r
+ return Collections.emptyList();\r
+ }\r