code: @VisibleForTesting
    static Dir estimateDirection(String str, boolean isHtml) {
      return BidiUtils.estimateDirection(str, isHtml);
    }
docs: Estimates the directionality of a string using the best known general-purpose method, i.e.
  using relative word counts. Dir.NEUTRAL return value indicates completely neutral input.
  
  @param str String whose directionality is to be estimated
  @param isHtml Whether {@code str} is HTML / HTML-escaped
  @return {@code str}'s estimated overall directionality