void () { MessageFormatUtil.MessageFormatResult result = MessageFormatUtil.checkFormat("{0}12345''''67890 it''''s{0, number, #.00}"); Assert.assertFalse(result.valid()); List<MessageFormatUtil.MessageFormatError> errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.MANY_QUOTES, errors.get(0).errorType()); Assert.assertEquals(20, errors.get(0).fromIndex()); Assert.assertEquals(24, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat("''''67890 it''''s''"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.MANY_QUOTES, errors.get(0).errorType()); Assert.assertEquals(12, errors.get(0).fromIndex()); Assert.assertEquals(16, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat("123 '{0, number, ''#.00}' 123"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.QUOTED_PLACEHOLDER, errors.get(0).errorType()); Assert.assertEquals(5, errors.get(0).fromIndex()); Assert.assertEquals(24, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat("'{1}'"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.QUOTED_PLACEHOLDER, errors.get(0).errorType()); Assert.assertEquals(1, errors.get(0).fromIndex()); Assert.assertEquals(4, errors.get(0).toIndex()); }