### Question:
EJBException extends RuntimeException { @Override public Throwable getCause() { return super.getCause() != null ? super.getCause() : getCausedByException(); } EJBException();  EJBException(Exception causeException);  EJBException(String message);  EJBException(String message, Exception causeException); Exception getCausedByException(); @Override Throwable getCause(); String getMessage(); void printStackTrace(PrintStream ps); void printStackTrace(PrintWriter pw); void printStackTrace();  }### Answer:
@Test public void testGetCause() { Assert.assertNull(exceptionDefaultConstructor.getCause()); Assert.assertNull(exceptionWithNullMessage.getCause()); Assert.assertNull(exceptionWithMessage.getCause()); Assert.assertNotNull(exceptionWithCausedBy.getCause()); Assert.assertNotNull(exceptionWithInitCause.getCause()); Assert.assertNotNull(exceptionWithCausedByAndInitCause.getCause()); Assert.assertNotNull(exceptionWithDifferentCausedByAndInitCause.getCause()); }