code: public void setEdge(Object vertex1, Object vertex2, Weight weight) {
          VertexMetadata vm1 = (VertexMetadata) vertices.get(vertex1);
          VertexMetadata vm2 = (VertexMetadata) vertices.get(vertex2);
          if (vm1 == null || vm2 == null) {
              return;
          }
          int index1 = vm1.index;
          int index2 = vm2.index;
          Edge e = new Edge(vertex1, vertex2, weight);
          Edge prev = edges[index1][index2];
          edges[index1][index2] = e;
          edgesArr = null;
          edgeModCount++;
          if (prev == null) {
              edgeCount++;
          }
      }
docs: Set the edge between two vertices. If the two given vertices don't exist,
  nothing happens. A <code>null</code> <code>weight</code> unsets the
  edge.
  
  @param vertex1
  a vertex.
  @param vertex2
  a vertex.
  @param weight
  the value of the edge.