Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The CalculatorTest program from chapter 1, shown in listing 2.1, defines a test class with a single test method testAdd.
The requirements to define a test class are that the class must be public and contain a zero-argument constructor. In our example, because we don’t define any other constructors, we don’t need to define the zero-argument constructor; Java creates it for us implicitly.