public static void assertException(RuntimeException exception,Runnable expression,String errorMessage){
  if (verbose) {
    log("assertException(" + exception + ", "+ expression+ ", "+ errorMessage+ ")");
  }
  try {
    expression.run();
  }
 catch (  RuntimeException failure) {
    if (exception.getClass() != failure.getClass()) {
      TestUtils.fail(errorMessage);
    }
    return;
  }
  TestUtils.fail(errorMessage);
}

public static void assertException ( RuntimeException exception , Runnable expression , String errorMessage ) { if ( verbose ) { log ( "assertException(" + exception + ", " + expression + ", " + errorMessage + ")" ) ; } try { expression . run ( ) ; } catch ( RuntimeException failure ) { if ( exception . getClass ( ) != failure . getClass ( ) ) { TestUtils . fail ( errorMessage ) ; } return ; } TestUtils . fail ( errorMessage ) ; }
asserts that a certain exception is raised
