<commit_before>package com.automician.core.angular.entities;

import com.automician.core.angular.wait.AngularWait;
import com.codeborne.selenide.*;
import com.codeborne.selenide.ex.UIAssertionError;
import com.codeborne.selenide.impl.*;
import com.codeborne.selenide.logevents.SelenideLog;
import com.codeborne.selenide.logevents.SelenideLogger;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;

import java.util.*;

import static com.codeborne.selenide.Condition.not;
import static com.codeborne.selenide.Configuration.assertionMode;
import static com.codeborne.selenide.Configuration.collectionsPollingInterval;
import static com.codeborne.selenide.Configuration.collectionsTimeout;
import static com.codeborne.selenide.Selenide.$;
import static com.codeborne.selenide.Selenide.sleep;
import static com.codeborne.selenide.logevents.ErrorsCollector.validateAssertionMode;
import static com.codeborne.selenide.logevents.LogEvent.EventStatus.PASS;
import static java.util.stream.Collectors.toList;


public class AngularCollection extends ElementsCollection {

    private ElementsCollection collection;

    public AngularCollection(ElementsCollection collection) {
        super(new WebElementsCollection() {
            @Override
            public List<WebElement> getActualElements() {
                return null;
            }

            @Override
            public String description() {
                return this.toString();
            }
        });
        this.collection = collection;
    }

    @Override
    public ElementsCollection shouldHave(final CollectionCondition... conditions) {
        AngularWait.waitForRequestsToFinish();
        this.collection.shouldHave(conditions);
        return this;
    }

    @Override
    protected ElementsCollection should(String prefix, CollectionCondition... conditions) {
        return this.shouldHave(conditions);
    }

    @Override
    public ElementsCollection shouldBe(final CollectionCondition... conditions) {
        return this.shouldHave(conditions);
    }

    @Override
    public ElementsCollection shouldHaveSize(int expectedSize) {
        return this.shouldHave(CollectionCondition.size(expectedSize));
    }

    @Override
    protected void waitUntil(CollectionCondition condition, long timeoutMs) {
        long oldTimeOut = Configuration.collectionsTimeout;
        try {
            Configuration.collectionsTimeout = timeoutMs;
            this.shouldHave(condition);
        } finally {
            Configuration.collectionsTimeout = oldTimeOut;
        }
    }

    @Override
    public ElementsCollection filter(final Condition condition) {
        return new AngularCollection(this.collection.filter(condition));
    }

    @Override
    public ElementsCollection filterBy(Condition condition) {
        return this.filter(condition);
    }

    @Override
    public ElementsCollection exclude(Condition condition) {
        return new AngularCollection(collection.exclude(condition));
    }

    @Override
    public ElementsCollection excludeWith(Condition condition) {
        return this.exclude(condition);
    }<commit_msg>AngularCollection refactoring<commit_after>package com.automician.core.angular.entities;

import com.automician.core.angular.wait.AngularWait;
import com.codeborne.selenide.*;
import com.codeborne.selenide.impl.*;
import org.openqa.selenium.WebElement;

import java.util.*;

public class AngularCollection extends ElementsCollection {

    private ElementsCollection collection;

    public AngularCollection(final ElementsCollection collection) {
        super(new WebElementsCollection() {
            @Override
            public List<WebElement> getActualElements() {
                List<WebElement> elements = new ArrayList<WebElement>();
                for (SelenideElement element : collection) {
                    elements.add(element.getWrappedElement());
                }
                return elements;
            }

            @Override
            public String description() {
                return "AngularCollection#WebElementsCollection " + this.toString();
            }
        });
        this.collection = collection;
    }

    @Override
    protected void waitUntil(CollectionCondition condition, long timeoutMs) {
        AngularWait.waitForRequestsToFinish();
        super.waitUntil(condition, timeoutMs);
    }

    @Override
    public ElementsCollection filter(final Condition condition) {
        return new AngularCollection(this.collection.filter(condition));
    }

    @Override
    public ElementsCollection filterBy(Condition condition) {
        return this.filter(condition);
    }

    @Override
    public ElementsCollection exclude(Condition condition) {
        return new AngularCollection(collection.exclude(condition));
    }

    @Override
    public ElementsCollection excludeWith(Condition condition) {
        return this.exclude(condition);
    }
{'fraction_non_alphanumeric': 0.08039492242595205, 'fraction_numerical': 0.0, 'mean_word_length': 3.1996615905245345, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6207689', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1192, 'n_words': 248}