private @Nullable List<Exclusion> @NotNull [] getAffectingExclusions(List<Exclusion> ranges, int[] offsets) {
    @SuppressWarnings("unchecked") List<Exclusion>[] affectingExclusions = new List[tokens.size()];

    for (Exclusion range : ranges) {
      boolean emptyRange = range.start == range.end;
      if (emptyRange && range.kind == ExclusionKind.exclude) continue;

      int i1 = findTokenIndex(range.start, offsets, true);
      int i2 = findTokenIndex(range.end, offsets, emptyRange);
      while (i2 > 0 && tokens.get(i2).length() == 0 && i2 > i1) i2--;

      for (int j = i1; j <= i2; j++) {
        List<Exclusion> affecting = affectingExclusions[j];
        if (affecting == null) affectingExclusions[j] = affecting = new ArrayList<>();
        affecting.add(range);
      }
    }
    return affectingExclusions;
  }
private @Nullable List<Exclusion> @NotNull [] getAffectingExclusions(List<Exclusion> ranges, int[] offsets)