Code example for InputMismatchException

0
    /** 
     * @tests java.util.InputMismatchException#InputMismatchException() 
     */ 
    @SuppressWarnings("cast") 
    public void test_Constructor() { 
        InputMismatchException exception = new InputMismatchException();
        assertNotNull(exception);
        assertTrue(exception instanceof NoSuchElementException);
        assertTrue(exception instanceof Serializable);
    } 
 
    /** 
     * @tests java.util.InputMismatchException#InputMismatchException(String) 
     */ 
    public void test_ConstructorLjava_lang_String() { 
        InputMismatchException exception = new InputMismatchException(
                ERROR_MESSAGE);
        assertNotNull(exception);
        assertEquals(ERROR_MESSAGE, exception.getMessage());
    }