### Question:
LinearizedChordDiagramGraphGenerator implements GraphGenerator<V, E, V> { @Override public void generateGraph( Graph<V, E> target, VertexFactory<V> vertexFactory, Map<String, V> resultMap) { List<V> nodes = new ArrayList<>(2 * n * m); for (int t = 0; t < n; t++) { V vt = vertexFactory.createVertex(); if (!target.addVertex(vt)) { throw new IllegalArgumentException("Invalid vertex factory"); } for (int j = 0; j < m; j++) { nodes.add(vt); V vs = nodes.get(rng.nextInt(nodes.size())); if (target.addEdge(vt, vs) == null) { throw new IllegalArgumentException("Graph does not permit parallel-edges."); } nodes.add(vs); } } } LinearizedChordDiagramGraphGenerator(int n, int m);  LinearizedChordDiagramGraphGenerator(int n, int m, long seed);  LinearizedChordDiagramGraphGenerator(int n, int m, Random rng); @Override void generateGraph(
        Graph<V, E> target, VertexFactory<V> vertexFactory, Map<String, V> resultMap);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testMultiGraph() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(10, 2, seed); Graph<Integer, DefaultEdge> g = new Multigraph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); }
@Test(expected = IllegalArgumentException.class) public void testSimpleGraph() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(10, 2, seed); Graph<Integer, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); }
@Test(expected = IllegalArgumentException.class) public void testDirectedMultiGraph() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(10, 2, seed); Graph<Integer, DefaultEdge> g = new DirectedMultigraph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); }
@Test(expected = IllegalArgumentException.class) public void testDirectedSimpleGraph() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(10, 2, seed); Graph<Integer, DefaultEdge> g = new SimpleDirectedGraph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); }
@Test public void testUndirected() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(20, 1, seed); Graph<Integer, DefaultEdge> g = new Pseudograph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); assertEquals(20, g.vertexSet().size()); }
@Test public void testUndirectedTwoEdges() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(20, 2, seed); Graph<Integer, DefaultEdge> g = new Pseudograph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); assertEquals(20, g.vertexSet().size()); }
@Test public void testDirected() { final long seed = 5; GraphGenerator<Integer, DefaultEdge, Integer> gen = new LinearizedChordDiagramGraphGenerator<>(20, 1, seed); Graph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(), null); assertEquals(20, g.vertexSet().size()); }