### Question:
JmsExceptionSupport { public static MessageFormatException createMessageFormatException(Throwable cause) { String message = cause.getMessage(); if (message == null || message.length() == 0) { message = cause.toString(); } MessageFormatException exception = new MessageFormatException(message); if (cause instanceof Exception) { exception.setLinkedException((Exception) cause); } exception.initCause(cause); return exception; } private  JmsExceptionSupport(); static JMSException create(String message, Throwable cause); static JMSException create(Throwable cause); static MessageEOFException createMessageEOFException(Throwable cause); static MessageFormatException createMessageFormatException(Throwable cause); static JMSRuntimeException createRuntimeException(Exception exception);  }### Answer:
@Test public void testCreateMessageFormatExceptionFillsMessageFromMCauseessageParamToString() { JMSException result = JmsExceptionSupport.createMessageFormatException(NO_MESSAGE_CAUSE); assertEquals(NO_MESSAGE_CAUSE.toString(), result.getMessage()); }
@Test public void testCreateMessageFormatExceptionFillsMessageFromMCauseessageParamToStringWhenMessageIsEmpty() { JMSException result = JmsExceptionSupport.createMessageFormatException(EMPTY_MESSAGE_CAUSE); assertEquals(EMPTY_MESSAGE_CAUSE.toString(), result.getMessage()); }
@Test public void testCreateMessageFormatExceptionAssignsLinkedException() { JMSException result = JmsExceptionSupport.createMessageFormatException(new IOException(CAUSE_MESSAGE)); assertNotNull(result.getLinkedException()); }
@Test public void testCreateMessageFormatExceptionDoesNotFillLinkedExceptionWhenGivenNonExceptionThrowable() { JMSException result = JmsExceptionSupport.createMessageFormatException(new AssertionError(CAUSE_MESSAGE)); assertNull(result.getLinkedException()); }