private static boolean anyRangeContains(Set<? extends TextRange> allRanges, TextRange inner) {
    for (TextRange outer : allRanges) {
      if (!inner.equals(outer) &&
          outer.contains(inner)) {
        return true;
      }
    }
    return false;
  }
private static boolean anyRangeContains(Set<? extends TextRange> allRanges, TextRange inner)