code: private static int findChoiceSubMessage(MessagePattern pattern, int partIndex, double number) {
          int count=pattern.countParts();
          int msgStart;
          // Iterate over (ARG_INT|DOUBLE, ARG_SELECTOR, message) tuples
          // until ARG_LIMIT or end of choice-only pattern.
          // Ignore the first number and selector and start the loop on the first message.
          partIndex+=2;
          for(;;) {
              // Skip but remember the current sub-message.
              msgStart=partIndex;
              partIndex=pattern.getLimitPartIndex(partIndex);
              if(++partIndex>=count) {
                  // Reached the end of the choice-only pattern.
                  // Return with the last sub-message.
                  break;
              }
              Part part=pattern.getPart(partIndex++);
              Part.Type type=part.getType();
              if(type==Part.Type.ARG_LIMIT) {
                  // Reached the end of the ChoiceFormat style.
                  // Return with the last sub-message.
                  break;
              }
              // part is an ARG_INT or ARG_DOUBLE
              assert type.hasNumericValue();
              double boundary=pattern.getNumericValue(part);
              // Fetch the ARG_SELECTOR character.
              int selectorIndex=pattern.getPatternIndex(partIndex++);
              char boundaryChar=pattern.getPatternString().charAt(selectorIndex);
              if(boundaryChar=='<' ? !(number>boundary) : !(number>=boundary)) {
                  // The number is in the interval between the previous boundary and the current one.
                  // Return with the sub-message between them.
                  // The !(a>b) and !(a>=b) comparisons are equivalent to
                  // (a<=b) and (a<b) except they "catch" NaN.
                  break;
              }
          }
          return msgStart;
      }
docs: Finds the ChoiceFormat sub-message for the given number.
  @param pattern A MessagePattern.
  @param partIndex the index of the first ChoiceFormat argument style part.
  @param number a number to be mapped to one of the ChoiceFormat argument's intervals
  @return the sub-message start part index.