presto-cli/src/main/java/io/prestosql/cli/AbstractWarningsPrinter.java/AbstractWarningsPrinter/getNewWarnings
class AbstractWarningsPrinter:    private List<String> getNewWarnings(List<Warning> warnings)
    {
        int end = warnings.size();
        if (maxWarnings.isPresent()) {
            end = Math.min(processedWarnings + maxWarnings.getAsInt(), end);
        }
        List<String> subList = warnings.subList(processedWarnings, end).stream()
                .map(this::getWarningMessage)
                .collect(toImmutableList());
        processedWarnings = end;
        return subList;
    }