### Question:
EJBException extends RuntimeException { public Exception getCausedByException() { return causeException; } 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 testGetCausedByException() { Assert.assertNull(exceptionDefaultConstructor.getCausedByException()); Assert.assertNull(exceptionWithNullMessage.getCausedByException()); Assert.assertNull(exceptionWithMessage.getCausedByException()); Assert.assertSame(exceptionWithCausedBy.getCause(), exceptionWithCausedBy.getCausedByException()); Assert.assertNull(exceptionWithInitCause.getCausedByException()); Assert.assertNotNull(exceptionWithCausedByAndInitCause.getCausedByException()); Assert.assertNotNull(exceptionWithDifferentCausedByAndInitCause.getCausedByException()); }