code: public static Exception getLowestException(final Exception exception, final String exceptionPrefix) {
  
  		if (exception == null) {
  			return null;
  		}
  
  		Throwable nestedException = (Throwable) exception;
  		Exception lastLowException = null;
  		while (nestedException != null) {
  			if (nestedException.getClass().toString().startsWith("class " + exceptionPrefix)) {
  				lastLowException = (Exception) nestedException;
  			}
  
  			nestedException = getInnerException(nestedException);
  		}
  
  		return lastLowException;
  	}
docs: Get the most inner exception that is exception from "exceptionPrefix"
  type. If the exception does not include inner exception of type
  "exceptionPrefix", returns null.
  
  @param exception
  @param exceptionPrefix
  @return