        // A driver program to test some of the state transitions of
        // an implementation of the StopWatch interface.
class TimerStateTest {
    public static void main(String[] args){
        boolean ok = true;
        final StopWatch timer = new TimingDevice();
        if(timer.getState() != StopWatch.RESET){
            System.err.println("State should be RESET after construction.");
            ok = false;
        }
        timer.start();
        if(timer.getState() != StopWatch.RUNNING){
            System.err.println("State should be RUNNING after start.");
            ok = false;
        }
        timer.suspend();
        if(timer.getState() != StopWatch.SUSPENDED){
            System.err.println("State should be SUSPENDED after suspend.");
            ok = false;
        }
        timer.resume();
        if(timer.getState() != StopWatch.RUNNING){
            System.err.println("State should be RUNNING after resume.");
            ok = false;
        }
        timer.stop();
        if(timer.getState() != StopWatch.STOPPED){
            System.err.println("State should be STOPPED after stop.");
            ok = false;
        }
        if(ok){
            System.out.println("Tests passed ok.");
        }
    }
}

