code: protected boolean containsChangesWithExternalDependencies( AtomicReference<Set<NodeKey>> affectedNodeKeys )
          throws RepositoryException {
          Set<NodeKey> allChanges = sessionCache().getChangedNodeKeys();
          Set<NodeKey> changesAtOrBelowThis = sessionCache().getChangedNodeKeysAtOrBelow(this.node());
          removeReferrerChanges(allChanges, changesAtOrBelowThis);
          if (affectedNodeKeys != null) affectedNodeKeys.set(changesAtOrBelowThis);
  
          return !changesAtOrBelowThis.containsAll(allChanges);
      }
docs: Determines whether this node, or any nodes below it, contain changes that depend on nodes that are outside of this node's
  hierarchy.
  
  @param affectedNodeKeys the reference that should be assigned to the set of node keys that are at or below this node; may
  be null if not needed
  @return true if this node's hierarchy has nodes with changes dependent on nodes from outside the hierarchy
  @throws InvalidItemStateException
  @throws ItemNotFoundException
  @throws RepositoryException