private static TextRange narrowRange(TextRange best, TextRange candidate) {
    return candidate != null && best.contains(candidate) ? candidate : best;
  }
private static TextRange narrowRange(TextRange best, TextRange candidate)