@NotNull
  public Pair<List<BekBranch>, BekEdgeRestrictions> getResult() {
    List<BekBranch> bekBranches = new ArrayList<>();

    for (int headNode : myGraphLayout.getHeadNodeIndex()) {
      if (myDoneNodes.get(headNode)) continue;
      List<Integer> nextBranch = createNextBranch(headNode);
      bekBranches.add(new BekBranch(myPermanentGraph, nextBranch));
    }
    return Pair.create(bekBranches, myEdgeRestrictions);
  }
@NotNull
  public Pair<List<BekBranch>, BekEdgeRestrictions> getResult()