title: org.testng.TestNGException: The following methods have cyclic dependencies while executing tests through TestNG
body: <p>The Testng exception displays the cyclic dependencies please explain </p>
  
  <pre><code>package test.depends;
  import org.testng.annotations.Test
  public class SimpleDependencyTes {
  @Test
  public void testOne() {
      System.out.println("The first method");
  }
  @Test(dependsOnMethods= {"testOne","testTwo"})
  public void testTwo() {
      System.out.println("The Second method");
  }
  }
  </code></pre>
  
  <p>Error is as follows:</p>
  
  <pre><code>org.testng.TestNGException: The following methods have cyclic dependencies:SimpleDependencyTes.testTwo()[pri:0, instance:test.depends.SimpleDependencyTes@1774679]
  at org.testng.internal.Graph.topologicalSort(Graph.java:149)
  at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:261)
  at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:317)
  at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:64)
  at org.testng.TestRunner.initMethods(TestRunner.java:438)
  at org.testng.TestRunner.init(TestRunner.java:271)
  at org.testng.TestRunner.init(TestRunner.java:241)
  at org.testng.TestRunner.&lt;init&gt;(TestRunner.java:192)
  at org.testng.remote.support.RemoteTestNG6_12$1.newTestRunner(RemoteTestNG6_12.java:33)
  at org.testng.remote.support.RemoteTestNG6_12$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_12.java:66)
  at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:713)
  at org.testng.SuiteRunner.init(SuiteRunner.java:260)
  at org.testng.SuiteRunner.&lt;init&gt;(SuiteRunner.java:198)
  at org.testng.TestNG.createSuiteRunner(TestNG.java:1295)
  at org.testng.TestNG.createSuiteRunners(TestNG.java:1273)
  at org.testng.TestNG.runSuitesLocally(TestNG.java:1128)
  at org.testng.TestNG.runSuites(TestNG.java:1049)
  at org.testng.TestNG.run(TestNG.java:1017)
  at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
  at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
  at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
  </code></pre>