// Path: src/test/java/io/github/marioluan/datastructures/factory/DigraphGraphFactory.java
// public final class DigraphGraphFactory {
//     private DigraphGraphFactory() {
//     }
// 
//     /**
//      * Builds a graph with the same vertices and edges from lecture slides. <br>
//      * <strong>https://algs4.cs.princeton.edu/lectures/42DirectedGraphs.pdf</strong>
//      */
//     public static Digraph build() {
//         Digraph graph = new Digraph(13);
// 
//         graph.addEdge(0, 1);
//         graph.addEdge(0, 5);
// 
//         graph.addEdge(2, 0);
//         graph.addEdge(2, 3);
// 
//         graph.addEdge(3, 2);
//         graph.addEdge(3, 5);
// 
//         graph.addEdge(4, 2);
//         graph.addEdge(4, 3);
// 
//         graph.addEdge(5, 4);
// 
//         graph.addEdge(6, 0);
//         graph.addEdge(6, 9);
//         graph.addEdge(6, 4);
//         graph.addEdge(6, 8);
// 
//         graph.addEdge(7, 6);
//         graph.addEdge(7, 9);
// 
//         graph.addEdge(8, 6);
// 
//         graph.addEdge(9, 10);
//         graph.addEdge(9, 11);
// 
//         graph.addEdge(10, 12);
// 
//         graph.addEdge(11, 12);
//         graph.addEdge(11, 4);
// 
//         graph.addEdge(12, 9);
// 
//         return graph;
//     }
// }
// 
// Path: src/test/java/io/github/marioluan/datastructures/factory/UndirectedGraphFactory.java
// public final class UndirectedGraphFactory {
//     /**
//      * Builds a graph with the same vertices and edges from lecture slides. <br>
//      * <strong>https://www.coursera.org/learn/algorithms-part2/lecture/mW9aG/depth-first-search</strong>
//      */
//     public static Undirected build() {
//         Undirected graph = new Undirected(13);
// 
//         graph.addEdge(0, 1);
//         graph.addEdge(0, 2);
//         graph.addEdge(0, 5);
//         graph.addEdge(0, 6);
//         graph.addEdge(6, 4);
//         graph.addEdge(4, 3);
//         graph.addEdge(4, 5);
//         graph.addEdge(3, 5);
// 
//         graph.addEdge(7, 8);
// 
//         graph.addEdge(9, 10);
//         graph.addEdge(9, 11);
//         graph.addEdge(9, 12);
//         graph.addEdge(11, 12);
// 
//         return graph;
//     }
// }


import com.greghaskins.spectrum.Spectrum;
import io.github.marioluan.datastructures.factory.DigraphGraphFactory;
import io.github.marioluan.datastructures.factory.UndirectedGraphFactory;
import org.junit.Assert;
import org.junit.runner.RunWith;
import java.util.Random;
import java.util.stream.IntStream;
import static com.greghaskins.spectrum.Spectrum.*;
                    Assert.assertSame(w, subject.adj(v).iterator().next());
                });
            });

            describe("#V", () -> {
                beforeEach(() -> {
                    V = 2;
                    subject = new Undirected(V);
                });

                it("returns the number of vertices", () -> {
                    Assert.assertEquals(V, subject.V());
                });
            });

            describe("#E", () -> {
                beforeEach(() -> {
                    w = new Random().nextInt(V);
                    v = new Random().nextInt(V);

                    subject.addEdge(v, w);
                });

                it("returns the number of edges", () -> {
                    Assert.assertEquals(1, subject.E());
                });
            });

            describe("#reverse", () -> {
                it("returns itself", () -> {
// Path: src/test/java/io/github/marioluan/datastructures/factory/DigraphGraphFactory.java
// public final class DigraphGraphFactory {
//     private DigraphGraphFactory() {
//     }
// 
//     /**
//      * Builds a graph with the same vertices and edges from lecture slides. <br>
//      * <strong>https://algs4.cs.princeton.edu/lectures/42DirectedGraphs.pdf</strong>
//      */
//     public static Digraph build() {
//         Digraph graph = new Digraph(13);
// 
//         graph.addEdge(0, 1);
//         graph.addEdge(0, 5);
// 
//         graph.addEdge(2, 0);
//         graph.addEdge(2, 3);
// 
//         graph.addEdge(3, 2);
//         graph.addEdge(3, 5);
// 
//         graph.addEdge(4, 2);
//         graph.addEdge(4, 3);
// 
//         graph.addEdge(5, 4);
// 
//         graph.addEdge(6, 0);
//         graph.addEdge(6, 9);
//         graph.addEdge(6, 4);
//         graph.addEdge(6, 8);
// 
//         graph.addEdge(7, 6);
//         graph.addEdge(7, 9);
// 
//         graph.addEdge(8, 6);
// 
//         graph.addEdge(9, 10);
//         graph.addEdge(9, 11);
// 
//         graph.addEdge(10, 12);
// 
//         graph.addEdge(11, 12);
//         graph.addEdge(11, 4);
// 
//         graph.addEdge(12, 9);
// 
//         return graph;
//     }
// }
// 
// Path: src/test/java/io/github/marioluan/datastructures/factory/UndirectedGraphFactory.java
// public final class UndirectedGraphFactory {
//     /**
//      * Builds a graph with the same vertices and edges from lecture slides. <br>
//      * <strong>https://www.coursera.org/learn/algorithms-part2/lecture/mW9aG/depth-first-search</strong>
//      */
//     public static Undirected build() {
//         Undirected graph = new Undirected(13);
// 
//         graph.addEdge(0, 1);
//         graph.addEdge(0, 2);
//         graph.addEdge(0, 5);
//         graph.addEdge(0, 6);
//         graph.addEdge(6, 4);
//         graph.addEdge(4, 3);
//         graph.addEdge(4, 5);
//         graph.addEdge(3, 5);
// 
//         graph.addEdge(7, 8);
// 
//         graph.addEdge(9, 10);
//         graph.addEdge(9, 11);
//         graph.addEdge(9, 12);
//         graph.addEdge(11, 12);
// 
//         return graph;
//     }
// }


// Path: src/test/java/io/github/marioluan/datastructures/graph/UndirectedTest.java
import com.greghaskins.spectrum.Spectrum;
import io.github.marioluan.datastructures.factory.DigraphGraphFactory;
import io.github.marioluan.datastructures.factory.UndirectedGraphFactory;
import org.junit.Assert;
import org.junit.runner.RunWith;
import java.util.Random;
import java.util.stream.IntStream;
import static com.greghaskins.spectrum.Spectrum.*;

                    Assert.assertSame(w, subject.adj(v).iterator().next());
                });
            });

            describe("#V", () -> {
                beforeEach(() -> {
                    V = 2;
                    subject = new Undirected(V);
                });

                it("returns the number of vertices", () -> {
                    Assert.assertEquals(V, subject.V());
                });
            });

            describe("#E", () -> {
                beforeEach(() -> {
                    w = new Random().nextInt(V);
                    v = new Random().nextInt(V);

                    subject.addEdge(v, w);
                });

                it("returns the number of edges", () -> {
                    Assert.assertEquals(1, subject.E());
                });
            });

            describe("#reverse", () -> {
                it("returns itself", () -> {
                    subject = UndirectedGraphFactory.build();