### Question:
MessageSourceMap extends AbstractMap<Object, Object> { @Override public String toString() { return new ToStringCreator(this).append("messageSource", this.messageSource) .append("prefixCodes", this.prefixCodes).toString(); } MessageSourceMap(MessageSource messageSource);  MessageSourceMap(MessageSource messageSource, String[] prefixCodes); @Override Object get(Object key); @SuppressWarnings("unchecked") Object get(Object... keys); @Override Set<Map.Entry<Object, Object>> entrySet(); @Override String toString();  }### Answer:
@Test public void shouldHaveToString() throws Exception { MessageSource messageSource = mock(MessageSource.class, "messageSource"); MessageSourceMap map = new TestMessageSourceMap(messageSource, new String[] { "a.", "b.", "c." }); assertThat(map.toString(), containsString("messageSource = messageSource, prefixCodes = array<String>['a.', 'b.', 'c.']]")); }