In this article, you will learn how to write unit tests for an application using a new testing framework called TestNG. TestNG takes its inspiration from JUnit, trying to maintain the latter's simplicity; at the same time, however, TestNG eliminates most of the limitations of the older framework and gives the developer the ability to write more flexible and powerful tests. As it heavily borrows from Java Annotations (introduced with JDK 5.0; see Resources for more information on this new feature) to define tests, it can also show you how to use this new feature of the Java language in a real production environment.