private <T extends Node<T, ?>> @NotNull Iterable<T> getNodesImpl(@NotNull ReferenceID id, Class<T> selector, boolean fromDeltaOnly) {
    if (id instanceof JvmNodeReferenceID && "".equals(((JvmNodeReferenceID)id).getNodeName())) {
      return Collections.emptyList();
    }
    Iterable<T> allNodes;
    if (myDelta != null) {
      Iterable<NodeSource> deltaSrc = myDelta.getSources(id);
      Iterable<NodeSource> deltaSources = fromDeltaOnly? deltaSrc : deltaSrc instanceof Set? deltaSrc : collect(deltaSrc, new HashSet<>()) /*ensure Set data structure*/;
      Iterable<T> deltaNodes = flat(map(deltaSources, src -> myDelta.getNodes(src, selector)));
      if (fromDeltaOnly) {
        allNodes = deltaNodes;
      }
      else {
        Set<NodeSource> deleted = myDelta.getDeletedSources();
        allNodes = flat(
          deltaNodes, flat(map(filter(myGraph.getSources(id), src -> !contains(deltaSources, src) && !deleted.contains(src) && mySourcesFilter.test(src)), src -> myGraph.getNodes(src, selector)))
        );
      }
    }
    else {
      allNodes = fromDeltaOnly? Collections.emptyList() : flat(map(filter(myGraph.getSources(id), mySourcesFilter::test), src -> myGraph.getNodes(src, selector)));
    }
    return uniqueBy(filter(allNodes, n -> id.equals(n.getReferenceID())), () -> new BooleanFunction<>() {
      Set<T> visited;

      @Override
      public boolean fun(T t) {
        if (visited == null) {
          visited = Containers.createCustomPolicySet(DiffCapable::isSame, DiffCapable::diffHashCode);
        }
        return visited.add(t);
      }
    });
  }
private <T extends Node<T, ?>> @NotNull Iterable<T> getNodesImpl(@NotNull ReferenceID id, Class<T> selector, boolean fromDeltaOnly)