void () { MessageFormatUtil.MessageFormatResult result = MessageFormatUtil.checkFormat("{0, wrong}"); Assert.assertFalse(result.valid()); List<MessageFormatUtil.MessageFormatError> errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.UNKNOWN_FORMAT_TYPE, errors.get(0).errorType()); Assert.assertEquals(3, errors.get(0).fromIndex()); Assert.assertEquals(9, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat("{0, wrong,}"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.UNKNOWN_FORMAT_TYPE, errors.get(0).errorType()); Assert.assertEquals(3, errors.get(0).fromIndex()); Assert.assertEquals(9, errors.get(0).toIndex()); }