@Test
public void testExceptionIn_toString() {

    Object o = new Object() {
        @Override
        public String toString() {
            throw new IllegalStateException("a");
        }
    };
    String result = MessageFormatter.format("Troublesome object {}", o).getMessage();
    assertEquals("Troublesome object [FAILED toString()]", result);
}