@Test
public void testWrapServletExceptionWithCause() {

    Throwable cause = createMock(Throwable.class);
    replay(cause);
    ServletException servletException = new ServletException(cause);
    IOException exception = ServletUtil.wrapServletException(servletException, "my message");
    assertEquals(cause, exception.getCause());
    assertEquals("my message", exception.getMessage());
    verify(cause);
}