@@ -0,0 +1,679 @@
+package com.gansuer.algorithms.graphs;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A * Created by Frank on 7/4/2016.%0A */%0Apublic class CycleTest extends GraphTestBase%7B%0A%0A    private Cycle cycle;%0A    @Before%0A    public void setUp() throws Exception %7B%0A        init(null);%0A        cycle = new Cycle(graph);%0A    %7D%0A%0A    @Test%0A    public void hasCycle() throws Exception %7B%0A        Assert.assertTrue(cycle.hasCycle());%0A    %7D%0A%0A    @Test%0A    public void getCycle() throws Exception %7B%0A        int%5B%5D case1 = %7B4,3,5,4%7D;%0A        int index =0 ;%0A        for (int item : cycle.getCycle())%7B%0A            Assert.assertEquals(case1%5Bindex++%5D,item);%0A        %7D%0A    %7D%0A%0A%7D%0A

update cycle