// 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;
//     }
// }


import com.greghaskins.spectrum.Spectrum;
import io.github.marioluan.datastructures.factory.DigraphGraphFactory;
import org.junit.Assert;
import org.junit.runner.RunWith;
import java.util.Random;
import java.util.stream.IntStream;
import static com.greghaskins.spectrum.Spectrum.*;
                });

                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", () -> {
                describe("when it's empty", () -> {
                    it("does not set any edges", () -> {
                        Digraph reversed = (Digraph) subject.reverse();
                        Assert.assertEquals(0, reversed.E());
                    });
                });

                describe("when it isn't empty", () -> {
                    beforeEach(() -> {
// 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/graph/DigraphTest.java
import com.greghaskins.spectrum.Spectrum;
import io.github.marioluan.datastructures.factory.DigraphGraphFactory;
import org.junit.Assert;
import org.junit.runner.RunWith;
import java.util.Random;
import java.util.stream.IntStream;
import static com.greghaskins.spectrum.Spectrum.*;

                });

                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", () -> {
                describe("when it's empty", () -> {
                    it("does not set any edges", () -> {
                        Digraph reversed = (Digraph) subject.reverse();
                        Assert.assertEquals(0, reversed.E());
                    });
                });

                describe("when it isn't empty", () -> {
                    beforeEach(() -> {
                        subject = DigraphGraphFactory.build();