void () { MessageFormatUtil.MessageFormatResult result = MessageFormatUtil.checkFormat( "{0}'' choice: {0, choice,0<more|1<''{0}''}"); Assert.assertFalse(result.valid()); List<MessageFormatUtil.MessageFormatError> errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.QUOTED_PLACEHOLDER, errors.get(0).errorType()); Assert.assertEquals(38, errors.get(0).fromIndex()); Assert.assertEquals(41, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat( "{0}'' choice: {0, choice,0<more|1<''{''}"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.UNMATCHED_BRACE, errors.get(0).errorType()); Assert.assertEquals(14, errors.get(0).fromIndex()); Assert.assertEquals(15, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat( "nested choice: {0, choice,0# inner'''{0, choice,1#test1|2#test2}'|3#1}}"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(34, errors.get(0).fromIndex()); Assert.assertEquals(37, errors.get(0).toIndex()); }