ServletException extends Exception { public Throwable getRootCause() { return rootCause; } ServletException();  ServletException(String message);  ServletException(String message, Throwable rootCause);  ServletException(Throwable rootCause); Throwable getRootCause();  }
@Test void testGetRootCause() { ServletException exception = new ServletException(); assertNull(exception.getRootCause()); }
@Test void testGetRootCause2() { ServletException exception = new ServletException(new RuntimeException()); assertNotNull(exception.getRootCause()); assertTrue(exception.getRootCause() instanceof RuntimeException); }