HistoneProcessingExceptionProcessor { protected Exception getRootCause(Exception exception) { Throwable cause = exception.getCause(); while (cause != null) { exception = (Exception) cause; cause = exception.getCause(); } return exception; }  final void process(HttpServletRequest request, HttpServletResponse response,
                              Exception exception, String templateLocation); HistoneProcessingExceptionProcessor setNext(HistoneProcessingExceptionProcessor processor);  }
@Test public void testGetRootCause() throws Exception { Exception result = exceptionProcessor.getRootCause(new Exception("WrongMessage0", new RuntimeException("WrongMessage1", new IllegalArgumentException("CorrectMessage")))); assertEquals(IllegalArgumentException.class, result.getClass()); assertThat(result.getMessage(), is("CorrectMessage")); }