test cases can be grouped and prioritizes more easily in testng code example
Example: how to set priority in testng
If we do not prioritize the test methods, then the test methods are selected
alphabetically and executed. If we want the test methods to be executed
in the sequence we want, then we need to provide the priority along with
the @Test annotation.
@Test(priority=2)
public void test1()
{
System.out.println("Test1");
}