question: public UidRange [ ] parseUidRange ( ) throws DecodingException { CharacterValidator validator = new MessageSetCharValidator ( ) ; String nextWord = consumeWord ( validator , true ) ; int commaPos = nextWord . indexOf ( ',' ) ; if ( commaPos == - 1 ) { return new UidRange [ ] { parseUidRange ( nextWord ) } ; } ArrayList < UidRange > rangeList = new ArrayList < UidRange > ( ) ; int pos = 0 ; while ( commaPos != - 1 ) { String range = nextWord . substring ( pos , commaPos ) ; UidRange set = parseUidRange ( range ) ; rangeList . add ( set ) ; pos = commaPos + 1 ; commaPos = nextWord . indexOf ( ',' , pos ) ; } String range = nextWord . substring ( pos ) ; rangeList . add ( parseUidRange ( range ) ) ; List < UidRange > merged = UidRange . mergeRanges ( rangeList ) ; return merged . toArray ( new UidRange [ merged . size ( ) ] ) ; }
target:  Reads a "message set" argument, and parses into an IdSet. This also support the use of $ as sequence-set as stated in SEARCHRES RFC5182 