### Question:
Message { public static Message of(String requestedKey, MessageTemplate messageTemplate, Object[] messageParameters) { ObjectUtil.requireNotNull(requestedKey, "requestedKey can't be null"); ObjectUtil.requireNotNull(messageTemplate, "messageTemplate can't be null"); ObjectUtil.requireNotNull(messageParameters, "messageParameters can't be null"); messageParameters = validateParameters(messageTemplate.getKey(), requestedKey, messageParameters); validateMessageTextFormat(messageTemplate.getText(), messageParameters); return new Message(requestedKey, messageTemplate, messageParameters); } private  Message(String requestedKey,
                    MessageTemplate messageTemplate,
                    Object[] messageParameters); static Message of(String requestedKey,
                             MessageTemplate messageTemplate,
                             Object[] messageParameters); String getConvertedText(); String mapToReadableText(); ApiMessageView mapToView(); ApiMessage mapToApiMessage(); String mapToLogMessage(); MessageTemplate getMessageTemplate(); static final String INVALID_KEY_MESSAGE; static final String INVALID_MESSAGE_TEXT_FORMAT; }### Answer:
@Test public void testRequestedKeyParam_whenItIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("requestedKey can't be null"); Message.of(null, null, null); }
@Test public void testMessageTemplateParam_whenItIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("messageTemplate can't be null"); Message.of("key", null, null); }
@Test public void testMessageParameters_whenItIsNull() { exception.expect(IllegalArgumentException.class); exception.expectMessage("messageParameters can't be null"); Message.of("key", new MessageTemplate(), null); }
@Test(expected = MissingFormatArgumentException.class) public void testCheckConvertValidation_whenThereAreMoreParamThanRequested() { Message.of("org.zowe.apiml.common.serviceTimeout", createMessageTemplate("No response received within the allowed time: %s %s"), new Object[]{"3000"}); }
@Test(expected = IllegalFormatConversionException.class) public void testCheckConvertValidation_whenThereIsWrongFormatThanRequested() { Message.of("org.zowe.apiml.common.serviceTimeout", createMessageTemplate("No response received within the allowed time: %d"), new Object[]{"3000"}); }