public void changeEdgeType(EdgeDirection direction, StatEdge edge, EdgeType newtype) {
    cancellationManager.checkCanceled();

    EdgeType oldtype = edge.getType();
    if (oldtype == newtype) {
      return;
    }

    if (oldtype == EdgeType.EXCEPTION || newtype == EdgeType.EXCEPTION) {
      throw new RuntimeException("Invalid edge type!");
    }

    removeEdgeDirectInternal(direction, edge, oldtype);
    addEdgeDirectInternal(direction, edge, newtype);

    if (direction == EdgeDirection.FORWARD) {
      edge.getDestination().changeEdgeType(EdgeDirection.BACKWARD, edge, newtype);
    }

    edge.setType(newtype);
  }
public void changeEdgeType(EdgeDirection direction, StatEdge edge, EdgeType newtype)