code: static int findSubMessage(MessagePattern pattern, int partIndex, String keyword) {
          int count=pattern.countParts();
          int msgStart=0;
          // Iterate over (ARG_SELECTOR, message) pairs until ARG_LIMIT or end of select-only pattern.
          do {
              MessagePattern.Part part=pattern.getPart(partIndex++);
              MessagePattern.Part.Type type=part.getType();
              if(type==MessagePattern.Part.Type.ARG_LIMIT) {
                  break;
              }
              assert type==MessagePattern.Part.Type.ARG_SELECTOR;
              // part is an ARG_SELECTOR followed by a message
              if(pattern.partSubstringMatches(part, keyword)) {
                  // keyword matches
                  return partIndex;
              } else if(msgStart==0 && pattern.partSubstringMatches(part, "other")) {
                  msgStart=partIndex;
              }
              partIndex=pattern.getLimitPartIndex(partIndex);
          } while(++partIndex<count);
          return msgStart;
      }
docs: /*package