code: List<Diag> errorsOnly(List<Diag> diagnostics) {
          return diagnostics.stream()
                  .filter(Diag::isError)
                  .collect(toList());
      }
docs: Filter diagnostics for only errors (no warnings, ...)
  @param diagnostics input list
  @return filtered list