class ExceptionUtils {

	public static Throwable stripException(Throwable throwableToStrip, Class<? extends Throwable> typeToStrip) {
		while (typeToStrip.isAssignableFrom(throwableToStrip.getClass()) && throwableToStrip.getCause() != null) {
			throwableToStrip = throwableToStrip.getCause();
		}

		return throwableToStrip;
	}

	private  ExceptionUtils();

}