@Test
public void testBasicExceptions() throws Exception {
final IllegalStateException expectedIllegalStateException = new IllegalStateException("expectedIllegalStateException");
expectedIllegalStateException.fillInStackTrace();
final HandlerException expectedHandlerException = new HandlerException(expectedIllegalStateException);
expectedHandlerException.fillInStackTrace();
final Exception expectedException = new Exception("expectedException", expectedHandlerException);
expectedException.fillInStackTrace();
final Exception actualException = serDeser(expectedException, Exception.class);
final HandlerException actualHandlerException = (HandlerException)actualException.getCause();
final IllegalStateException actualIllegalStateException = (IllegalStateException)actualHandlerException.getCause();
Assert.assertEquals(expectedException.getMessage(), actualException.getMessage());
Assert.assertEquals(expectedHandlerException.getMessage(), actualHandlerException.getMessage());
Assert.assertEquals(expectedIllegalStateException.getMessage(), actualIllegalStateException.getMessage());
Assert.assertEquals(expectedException.getStackTrace().length, actualException.getStackTrace().length);
Assert.assertEquals(expectedHandlerException.getStackTrace().length, actualHandlerException.getStackTrace().length);
Assert.assertEquals(expectedIllegalStateException.getStackTrace().length, actualIllegalStateException.getStackTrace().length);
Assert.assertEquals(expectedHandlerException.isWrapper(), actualHandlerException.isWrapper());
}