Program: 38786
Project: 38786
Buggy source:
void traverse(BusTerminal terminal,VoltageLevel.TopologyTraverser traverser,Set<Terminal> traversedTerminals){
  Objects.requireNonNull(terminal);
  Objects.requireNonNull(traverser);
  Objects.requireNonNull(traversedTerminals);
  if (traversedTerminals.contains(terminal)) {
    return;
  }
  List<TerminalExt> nextTerminals=new ArrayList<>();
  if (traverser.traverse(terminal,terminal.isConnected())) {
    traversedTerminals.add(terminal);
    addNextTerminals(terminal,nextTerminals);
    int v=getVertex(terminal.getConnectableBusId(),true);
    ConfiguredBus bus=graph.getVertexObject(v);
    for (    BusTerminal otherTerminal : bus.getTerminals()) {
      if (otherTerminal != terminal) {
        if (traverser.traverse(otherTerminal,otherTerminal.isConnected())) {
          addNextTerminals(otherTerminal,nextTerminals);
        }
      }
    }
    graph.traverse(v,(v1,e,v2) -> {
      SwitchImpl aSwitch=graph.getEdgeObject(e);
      ConfiguredBus otherBus=graph.getVertexObject(v2);
      if (traverser.traverse(aSwitch)) {
        for (        BusTerminal otherTerminal : otherBus.getTerminals()) {
          if (traverser.traverse(otherTerminal,otherTerminal.isConnected())) {
            traversedTerminals.add(otherTerminal);
            addNextTerminals(otherTerminal,nextTerminals);
            return TraverseResult.CONTINUE;
          }
 else {
            return TraverseResult.TERMINATE;
          }
        }
        return TraverseResult.CONTINUE;
      }
 else {
        return TraverseResult.TERMINATE;
      }
    }
);
    for (    TerminalExt nextTerminal : nextTerminals) {
      nextTerminal.traverse(traverser,traversedTerminals);
    }
  }
}

Fixed version (ground truth):
void traverse(BusTerminal terminal,VoltageLevel.TopologyTraverser traverser,Set<Terminal> traversedTerminals){
  Objects.requireNonNull(terminal);
  Objects.requireNonNull(traverser);
  Objects.requireNonNull(traversedTerminals);
  if (traversedTerminals.contains(terminal)) {
    return;
  }
  List<TerminalExt> nextTerminals=new ArrayList<>();
  if (traverser.traverse(terminal,terminal.isConnected())) {
    traversedTerminals.add(terminal);
    addNextTerminals(terminal,nextTerminals);
    int v=getVertex(terminal.getConnectableBusId(),true);
    ConfiguredBus bus=graph.getVertexObject(v);
    bus.getTerminals().stream().filter(t -> t != terminal).filter(t -> traverser.traverse(t,t.isConnected())).forEach(t -> addNextTerminals(t,nextTerminals));
    graph.traverse(v,(v1,e,v2) -> {
      SwitchImpl aSwitch=graph.getEdgeObject(e);
      ConfiguredBus otherBus=graph.getVertexObject(v2);
      if (traverser.traverse(aSwitch)) {
        for (        BusTerminal otherTerminal : otherBus.getTerminals()) {
          if (traverser.traverse(otherTerminal,otherTerminal.isConnected())) {
            traversedTerminals.add(otherTerminal);
            addNextTerminals(otherTerminal,nextTerminals);
            return TraverseResult.CONTINUE;
          }
          return TraverseResult.TERMINATE;
        }
        return TraverseResult.CONTINUE;
      }
      return TraverseResult.TERMINATE;
    }
);
    nextTerminals.forEach(t -> t.traverse(traverser,traversedTerminals));
  }
}