GemFireSecurityException extends GemFireException { @Override public synchronized Throwable getCause() { return (this.cause == this ? null : this.cause); } GemFireSecurityException(final String message);  GemFireSecurityException(final Throwable cause);  GemFireSecurityException(final String message, final Throwable cause); @Override synchronized Throwable getCause();  }
@Test public void serializesWithThrowable() { Throwable cause = new Exception(causeMessage); GemFireSecurityException instance = new GemFireSecurityException(message, cause); GemFireSecurityException cloned = (GemFireSecurityException) SerializationUtils.clone(instance); assertThat(cloned).hasMessage(message).hasCause(cause); assertThat(cloned.getCause()).hasMessage(causeMessage); }