private void cleanupDependencies(Node<?, ?> node, Map<ReferenceID, Set<ReferenceID>> depsToRemove) {
    ReferenceID nodeID = node.getReferenceID();
    for (ReferenceID referentId : getIndexedDependencies(node)) {
      depsToRemove.computeIfAbsent(referentId, k -> new HashSet<>()).add(nodeID);
    }
  }
private void cleanupDependencies(Node<?, ?> node, Map<ReferenceID, Set<ReferenceID>> depsToRemove)