docs: void mergeClusters_(int cluster_1, int cluster2) {
  		// dbg_check_cluster_(cluster_1);
  		// dbg_check_cluster_(cluster2);
  		int eventQnode = getClusterEventQNode(cluster2);
  		if (eventQnode != -1) {
  			m_event_q.deleteNode(eventQnode, -1);
  			setClusterEventQNode_(cluster2, -1);
  		}
  
  		int firstEdge1 = getClusterFirstEdge(cluster_1);
  		int firstEdge2 = getClusterFirstEdge(cluster2);
  
  		if (firstEdge2 != -1) {// scope
  			int edge2 = firstEdge2;
  			int lastEdge = firstEdge2;
  			boolean bForceContinue = false;
  			// Delete edges that connect cluster_1 and cluster2.
  			do {
  				// dbg_check_edge_(edge2);
  				bForceContinue = false;
  				// assert(!StridedIndexTypeCollection.isValidElement(getEdgeSweepNode(edge2)));
  				int end = getEdgeEnd(edge2, cluster2);
  				int nextEdge2 = getNextEdgeEx(edge2, end);
  				if (getEdgeCluster(edge2, (end + 1) & 1) == cluster_1) { // Snapping
  																			// clusters
  																			// that
  																			// are
  																			// connected
  																			// with
  																			// an
  																			// edge
  																			// Delete
  																			// the
  																			// edge.
  					disconnectEdge_(edge2);
  					int edgeOrigins2 = getEdgeOriginVertices(edge2);
  					m_edge_vertices.deleteList(edgeOrigins2);
  					deleteEdge_(edge2);
  					if (edge2 == nextEdge2) {// deleted last edge connecting to
  												// the cluster2 (all connections
  												// are degenerate)
  						firstEdge2 = -1;
  						break;
  					}
  					if (firstEdge2 == edge2) {
  						firstEdge2 = getClusterFirstEdge(cluster2);
  						lastEdge = nextEdge2;
  						bForceContinue = true;
  					}
  				} else {
  					assert (edge2 != getClusterFirstEdge(cluster_1));
  				}
  				edge2 = nextEdge2;
  			} while (edge2 != lastEdge || bForceContinue);
  
  			if (firstEdge2 != -1) {
  				// set the cluster to the edge ends
  				do {
  					int end = getEdgeEnd(edge2, cluster2);
  					int nextEdge2 = getNextEdgeEx(edge2, end);
  					assert (edge2 != getClusterFirstEdge(cluster_1));
  					setEdgeCluster_(edge2, end, cluster_1);
  					edge2 = nextEdge2;
  				} while (edge2 != lastEdge);
  
  				firstEdge1 = getClusterFirstEdge(cluster_1);
  				if (firstEdge1 != -1) {
  					int next1 = getNextEdge(firstEdge1, cluster_1);
  					int next2 = getNextEdge(firstEdge2, cluster_1);
  					if (next1 == firstEdge1) {
  						setClusterFirstEdge_(cluster_1, firstEdge2);
  						addEdgeToClusterImpl_(firstEdge1, cluster_1);
  						setClusterFirstEdge_(cluster_1, firstEdge1);
  					} else if (next2 == firstEdge2) {
  						addEdgeToClusterImpl_(firstEdge2, cluster_1);
  					}
  
  					setNextEdge_(firstEdge2, cluster_1, next1);
  					setPrevEdge_(next1, cluster_1, firstEdge2);
  					setNextEdge_(firstEdge1, cluster_1, next2);
  					setPrevEdge_(next2, cluster_1, firstEdge1);
  				} else {
  					setClusterFirstEdge_(cluster_1, firstEdge2);
  				}
  			}
  		}
  
  		int vertices1 = getClusterVertices(cluster_1);
  		int vertices2 = getClusterVertices(cluster2);
  		// Update cluster info on vertices.
  		for (int vh = m_cluster_vertices.getFirst(vertices2); vh != -1; vh = m_cluster_vertices
  				.getNext(vh)) {
  			int v = m_cluster_vertices.getElement(vh);
  			m_shape.setUserIndex(v, m_vertex_cluster_index, cluster_1);
  		}
  		m_cluster_vertices.concatenateLists(vertices1, vertices2);
  		deleteCluster_(cluster2);
  		// dbg_check_cluster_(cluster_1);
  	}