In the previous Rock Bands test class example, we listed some of the annotations that tell TestNG whether a certain method should be run before or after certain points in time during the test run. These are the setup and teardown methods. They come before and after a suite, test, groups, class, and method.
As simple as it may seem, there are various rules and orders of precedence when using them. Let's look at some examples.