public void replaceSuccessor(BasicBlock oldBlock, BasicBlock newBlock) {
    for (int i = 0; i < successors.size(); i++) {
      if (successors.get(i).id == oldBlock.id) {
        successors.set(i, newBlock);
        oldBlock.removePredecessor(this);
        newBlock.addPredecessor(this);
      }
    }

    for (int i = 0; i < successorExceptions.size(); i++) {
      if (successorExceptions.get(i).id == oldBlock.id) {
        successorExceptions.set(i, newBlock);
        oldBlock.removePredecessorException(this);
        newBlock.addPredecessorException(this);
      }
    }
  }
public void replaceSuccessor(BasicBlock oldBlock, BasicBlock newBlock)