code: Throwable getExpectedCause(Class expectedExceptionClass, 
  			       Throwable exception) {
  	Throwable result = exception.getCause();
  	if (null != result) {
  	    if (!expectedExceptionClass.isAssignableFrom(result.getClass())) {
  		result = getExpectedCause(expectedExceptionClass, result);
  	    }
  	}
  	return result;
      }
docs: <p>Recursively interrogate the <code>cause</code> property of the
  argument <code>exception</code> and stop recursing either when it
  is an instance of <code>expectedExceptionClass</code> or
  <code>null</code>.  Return the result.</p>