class Command {

    Optional<Integer> getHighestReportSeverity(final @NotNull Options opts,
                                               final @NotNull List<CheckReport> reports) {
        return reports.stream()
                .flatMap(compose1(CheckReport::getViolations, Collection::stream))
                .map(Violation::getSeverity)
                .reduce(Severity::maxSeverity)
                .filter(opts.getFailOnSeverity().meetsMinimumSeverity())
                .map(severity -> {
                    switch (severity) {
                        case SEVERE:
                            return EXIT_SEVERE_VIOLATION;
                        case MAJOR:
                            return EXIT_MAJOR_VIOLATION;
                        case MINOR:
                        default:
                            return EXIT_MINOR_VIOLATION;
                    }
                });
    }

}