Code example for IllegalStateException

0
     * @param harness  the test harness (<code>null</code> not permitted). 
     */ 
    public void test(TestHarness harness) 
    { 
        // create instance of a class IllegalStateException 
        IllegalStateException o = new IllegalStateException("IllegalStateException"); 
 
        // basic check of instanceof operator 
        harness.check(o instanceof IllegalStateException); 
 
        // check operator instanceof against all superclasses 
        harness.check(o instanceof RuntimeException); 
        harness.check(o instanceof Exception); 
        harness.check(o instanceof Throwable); 
        harness.check(o instanceof Object); 
    } 
}