<commit_before>package com.centurylink.cloud.sdk.servers.client.domain.server;

import com.centurylink.cloud.sdk.core.client.ClcClientException;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toList;

public class BaseServerListResponse extends ArrayList<BaseServerResponse> {

    public BaseServerListResponse(int initialCapacity) {
        super(initialCapacity);
    }

    public BaseServerListResponse() {
    }

    public BaseServerListResponse(Collection<? extends BaseServerResponse> collection) {
        super(collection);
    }

    public List<Exception> listExceptions() {
        return
            Stream
                .concat(
                    this
                        .stream()
                        .filter(r -> r.getErrorMessage() != null)
                        .map(r -> new ClcClientException(r.getErrorMessage())),
                    this
                        .stream()
                        .filter(r -> !r.getQueued())
                        .map(r -> new ClcClientException("Job for resource %s not quequed", r.getServer()))
                )
                .collect(toList());
    }

    public ClcClientException summaryException() {
        if (!hasErrors()) {
            ClcClientException ex = new ClcClientException();
            listExceptions().forEach(ex::addSuppressed);
            return ex;
        } else {
            return null;
        }
    }

    public boolean hasErrors() {<commit_msg>Development prototype of method that allow to collect error messages during batch operations #26<commit_after>package com.centurylink.cloud.sdk.servers.client.domain.server;

import com.centurylink.cloud.sdk.core.client.ClcClientException;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toList;

public class BaseServerListResponse extends ArrayList<BaseServerResponse> {

    public BaseServerListResponse(int initialCapacity) {
        super(initialCapacity);
    }

    public BaseServerListResponse() {
    }

    public BaseServerListResponse(Collection<? extends BaseServerResponse> collection) {
        super(collection);
    }

    public List<Exception> listExceptions() {
        return
            Stream
                .concat(
                    this
                        .stream()
                        .filter(r -> r.getErrorMessage() != null)
                        .map(r -> new ClcClientException(r.getErrorMessage())),
                    this
                        .stream()
                        .filter(r -> !r.getQueued())
                        .map(r -> new ClcClientException("Job for resource %s not quequed", r.getServer()))
                )
                .collect(toList());
    }

    public ClcClientException summaryException() {
        if (hasErrors()) {
            ClcClientException ex = new ClcClientException();
            listExceptions().forEach(ex::addSuppressed);
            return ex;
        } else {
            return null;
        }
    }

    public boolean hasErrors() {
{'fraction_non_alphanumeric': 0.09702380952380953, 'fraction_numerical': 0.0005952380952380953, 'mean_word_length': 2.033393501805054, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6278390', 'n_tokens_mistral': 863, 'n_tokens_neox': 834, 'n_words': 177}