IdMaskSecurityException extends SecurityException { @Override public String getMessage() { return "[" + reason + "] " + super.getMessage(); } IdMaskSecurityException(String s, Reason reason);  IdMaskSecurityException(String message, Reason reason, Throwable cause); Reason getReason(); @Override String getMessage();  }
@Test public void getMessage() { for (IdMaskSecurityException.Reason reason : IdMaskSecurityException.Reason.values()) { assertNotNull(new IdMaskSecurityException("test message", reason).getMessage()); } }