code: public boolean partSubstringMatches(Part part, String s) {
          return part.length == s.length() && msg.regionMatches(part.index, s, 0, part.length);
      }
docs: Compares the part's substring with the input string s.
  @param part a part of this MessagePattern.
  @param s a string.
  @return true if getSubstring(part).equals(s).