code: private static void processRecords(List<String> result, List<CSVRecord> records, Function<String, String> valueProcessor) {
      for (CSVRecord csvRecord : records) {
        Iterator<String> it = csvRecord.iterator();
        if (!result.isEmpty()) {
          String next = it.next();
          if (!next.isEmpty()) {
            int lastItemIdx = result.size() - 1;
            String previous = result.get(lastItemIdx);
            if (previous.isEmpty()) {
              result.set(lastItemIdx, valueProcessor.apply(next));
            } else {
              result.set(lastItemIdx, valueProcessor.apply(previous + "\n" + next));
            }
          }
        }
        it.forEachRemaining(s -> {
          String apply = valueProcessor.apply(s);
          result.add(apply);
        });
      }
    }
docs: In most cases we expect a single record. <br>Having multiple records means the input value was splitted over multiple lines (this is common in Maven).
  For example:
  <pre>
  &lt;sonar.exclusions&gt;
  src/foo,
  src/bar,
  src/biz
  &lt;sonar.exclusions&gt;
  </pre>
  In this case records will be merged to form a single list of items. Last item of a record is appended to first item of next record.
  <p>
  This is a very curious case, but we try to preserve line break in the middle of an item:
  <pre>
  &lt;sonar.exclusions&gt;
  a
  b,
  c
  &lt;sonar.exclusions&gt;
  </pre>
  will produce ['a\nb', 'c']