### Question:
MessageLookupMessageValueFormatter extends
        ToStringMessageValueFormatter { @Override public String format(Object value) { String valueAsString = super.format(value); return messages.getMessage(valueAsString, valueAsString); } MessageLookupMessageValueFormatter(MessageSource messages); @Override String format(Object value);  }### Answer:
@Test public void testFormatObject() { final String value = "key.something"; final String expectedResult = "Some Text"; when(messages.getMessage(value, null, value, locale)).thenReturn( expectedResult); final String testResult = testee.format(value); assertThat(testResult).isEqualTo(expectedResult); }