Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 16443)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 16444)
@@ -1608,8 +1608,9 @@
 
         // add parent relations of nearby nodes and ways
-        nearestList.stream()
-                .flatMap(o -> o.getReferrers().stream())
-                .filter(r -> r instanceof Relation && predicate.test(r))
-                .forEach(nearestList::add);
+        Set<OsmPrimitive> parentRelations = nearestList.stream()
+                .flatMap(o -> o.referrers(Relation.class))
+                .filter(predicate)
+                .collect(Collectors.toSet());
+        nearestList.addAll(parentRelations);
 
         if (ignore != null) {
