@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); }
static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[]{arg}); }
MessageFormatter { static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[]{arg}); } }
MessageFormatter { static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[]{arg}); } private  MessageFormatter(); }
MessageFormatter { static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[]{arg}); } private  MessageFormatter();  }
MessageFormatter { static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[]{arg}); } private  MessageFormatter();   }