void () { MessageFormatUtil.MessageFormatResult result = MessageFormatUtil.checkFormat( "{0} choice: {0, choice,-1#'''' - 2 quotes|0<more|2<''{0}'' '''' - 1 quotes|3#{0, number, #.00}}"); Assert.assertFalse(result.valid()); List<MessageFormatUtil.MessageFormatError> errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.SELECTOR_NOT_FOUND, errors.get(0).errorType()); Assert.assertEquals(91, errors.get(0).fromIndex()); Assert.assertEquals(92, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat( "{0}'' choice: {0, choice,0<more|wrong<wrong}"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.INCORRECT_CHOICE_SELECTOR, errors.get(0).errorType()); Assert.assertEquals(34, errors.get(0).fromIndex()); Assert.assertEquals(39, errors.get(0).toIndex()); result = MessageFormatUtil.checkFormat( "{0}'' choice: {0, choice,0<more|-1<wrong}"); Assert.assertFalse(result.valid()); errors = result.errors(); Assert.assertEquals(1, errors.size()); Assert.assertEquals(MessageFormatUtil.MessageFormatErrorType.INCORRECT_ORDER_CHOICE_SELECTOR, errors.get(0).errorType()); Assert.assertEquals(34, errors.get(0).fromIndex()); Assert.assertEquals(36, errors.get(0).toIndex()); }