static public void doRejectionTest(String data,Class exceptionClass){
  try {
    MIMEType t=new MIMEType(data);
  }
 catch (  Throwable t) {
    if (exceptionClass.isInstance(t))     return;
    t.printStackTrace(System.err);
    throw new AssertionFailedError2("Should have thrown " + exceptionClass + " instead"+ ", not "+ t.getClass()+ " for data='"+ data+ "'",t);
  }
  throw new AssertionFailedError("Should have thrown " + exceptionClass + " for data='"+ data+ "'");
}

static public void doRejectionTest ( String data , Class exceptionClass ) { try { MIMEType t = new MIMEType ( data ) ; } catch ( Throwable t ) { if ( exceptionClass . isInstance ( t ) ) return ; t . printStackTrace ( System . err ) ; throw new AssertionFailedError2 ( "Should have thrown " + exceptionClass + " instead" + ", not " + t . getClass ( ) + " for data='" + data + "'" , t ) ; } throw new AssertionFailedError ( "Should have thrown " + exceptionClass + " for data='" + data + "'" ) ; }
test helper submits data that should produce an exception of the indicated class .
