private List<Range> determineLineRangesToFilterFor(Map<String, Object> attributes) {
          List<Range> result = new ArrayList<>();
          boolean[] invalidRangeFound = {false};

          splitList(attributes.getOrDefault("lines", "").toString())
            // stop iterating as soon as an invalid range was found
            .takeWhile(__ -> !invalidRangeFound[0])
            .forEach(range -> {
              if (range.contains("..")) {
                // we found a from..to range, extract the bounds like Ruby does it
                String[] bounds = SPLIT_RANGE_PATTERN.split(range, 2);
                Integer from = extractInteger(bounds[0]);
                if ((from == null) || (from == 0)) {
                  invalidRangeFound[0] = true;
                  return;
                }
                Integer to = extractInteger(bounds[1]);
                if ((to == null) || (to < 0)) {
                  to = Integer.MAX_VALUE;
                }
                result.add(new Range(from, to));
              } else {
                // we found a single line, extract it like Ruby does it
                Integer from = extractInteger(range);
                if ((from == null) || (from == 0)) {
                  invalidRangeFound[0] = true;
                  return;
                }
                result.add(new Range(from, from));
              }
            });

          // if invalid range was found return null, so that nothing is included
          return invalidRangeFound[0] ? null : result;
        }
Determine the line ranges to filter for from the attributes.

@param attributes The attributes to extract the lines configuration from
@return {@code null} if an invalid range was found, otherwise the line ranges to filter the included file for
build-logic/asciidoc-extensions/src/main/java/org/spockframework/plugins/asciidoctor/IncludedSourceLinker.java