When a node in a graph is a graph and this node has links to other nodes then we get a crash in the method expand.
Code fixed as follows.
the method
public Graph expand(Graph inGraph, Graph clusterGraph)
of public class GraphCollapser
in the package
package edu.uci.ics.jung.visualization.subLayout;
has the following bugs in the code
if(cluster.containsAll(endpoints) == false) {
if(clusterGraph.equals(v1)) {
// i need a new v1
Object originalV1 = originalGraph.getEndpoints(edge).getFirst();
/* this line should be
Object newV1 = findVertex(ingraph, originalV1);*/
Object newV1 = findVertex(graph, originalV1);
assert newV1 != null : "newV1 for "+originalV1+" was not found!";
graph.addEdge(edge, newV1, v2, inGraph.getEdgeType(edge));
} else if(clusterGraph.equals(v2)) {
// i need a new v2
Object originalV2 = originalGraph.getEndpoints(edge).getSecond();
/* this line should be
Object newV1 = findVertex(ingraph, originalV2);*/
Object newV2 = findVertex(graph, originalV2);
assert newV2 != null : "newV2 for "+originalV2+" was not found!";
graph.addEdge(edge, v1, newV2, inGraph.getEdgeType(edge));
} else {
graph.addEdge(edge, v1, v2, inGraph.getEdgeType(edge));
}