code: public static String getNormalizedText(String elementText) {
          String result = null;
          if (elementText != null) {
              result = WHITESPACE_REPLACE.matcher(elementText).replaceAll(" ");
          }
          return result;
      }
docs: Mimics effect of 'normalized()` xPath function on Java String.
  Replaces &nbsp; by normal space, and collapses whitespace sequences to single space
  @param elementText text in element.
  @return normalized text.