2.1. How do I write a test?

The simplest test is an ordinary Java program with the usual static main method. If the test fails, it should throw an exception; if it succeeds, it should return normally.

Here's an example:

/* @test 1.1 97/10/12
   @bug 1234567
   @summary Make sure that 1 != 0
*/

public class OneZero {

    public static void main(String[] args) throws Exception {
        if (1 == 0) {
            throw new Exception("1 == 0");
        }
    }

}
                    

This test could be run on its own with the command

<build>/bin/java OneZero
where <build> is the location of the JDK build that you're testing.