void (Node<?, ?> node, Map<ReferenceID, Set<ReferenceID>> depsToRemove) { ReferenceID nodeID = node.getReferenceID(); for (ReferenceID referentId : getIndexedDependencies(node)) { Set<ReferenceID> deps = depsToRemove.get(referentId); if (deps == null) { depsToRemove.put(referentId, deps = new HashSet<>()); } deps.add(nodeID); } }