<commit_before>package clientapi.util.entity;

import net.minecraft.entity.Entity;

import java.util.*;
import java.util.stream.Collectors;

/**
 * {@code EntityFilter} implementation that can have multiple child entity filters.
 *
 * @author Brady
 * @since 11/7/2017 12:14 PM
 */
public final class MultiEntityFilter implements EntityFilter {

    /**
     * The child {@code EntityFilters} that are run when checking the validity of an {@code Entity}
     */
    private final List<EntityFilter> filters = new ArrayList<>();

    public MultiEntityFilter() {}

    public MultiEntityFilter(EntityFilter... filters) {
        this(Arrays.asList(filters));
    }

    public MultiEntityFilter(Iterable<EntityFilter> filters) {
        filters.forEach(this.filters::add);
    }

    @Override
    public final boolean isValid(Entity entity) {
        if (entity == null)
            return false;

        return this.filters.stream().filter(filter -> !filter.isValid(entity)).count() > 0;
    }

    /**
     * Adds the specified filter to this {@code MultiEntityFilter}
     * if it is not already a child filter.
     *
     * @param filter The filter to add
     */
    public final void addFilter(EntityFilter filter) {
        if (!this.filters.contains(filter))
            this.filters.add(filter);
    }

    /**
     * Removes the specified filter from this {@code MultiEntityFilter}
     * if it is already a child filter.
     *
     * @param filter The filter to add
     */
    public final void removeFilter(EntityFilter filter) {
        if (this.filters.contains(filter))
            this.filters.remove(filter);
    }
<commit_msg>Fixed MultiEntityFilter bug<commit_after>package clientapi.util.entity;

import net.minecraft.entity.Entity;

import java.util.*;
import java.util.stream.Collectors;

/**
 * {@code EntityFilter} implementation that can have multiple child entity filters.
 *
 * @author Brady
 * @since 11/7/2017 12:14 PM
 */
public final class MultiEntityFilter implements EntityFilter {

    /**
     * The child {@code EntityFilters} that are run when checking the validity of an {@code Entity}
     */
    private final List<EntityFilter> filters = new ArrayList<>();

    public MultiEntityFilter() {}

    public MultiEntityFilter(EntityFilter... filters) {
        this(Arrays.asList(filters));
    }

    public MultiEntityFilter(Iterable<EntityFilter> filters) {
        filters.forEach(this.filters::add);
    }

    @Override
    public final boolean isValid(Entity entity) {
        return entity != null && this.filters.stream().filter(filter -> !filter.isValid(entity)).count() == 0;

    }

    /**
     * Adds the specified filter to this {@code MultiEntityFilter}
     * if it is not already a child filter.
     *
     * @param filter The filter to add
     */
    public final void addFilter(EntityFilter filter) {
        if (!this.filters.contains(filter))
            this.filters.add(filter);
    }

    /**
     * Removes the specified filter from this {@code MultiEntityFilter}
     * if it is already a child filter.
     *
     * @param filter The filter to add
     */
    public final void removeFilter(EntityFilter filter) {
        if (this.filters.contains(filter))
            this.filters.remove(filter);
    }

{'fraction_non_alphanumeric': 0.10625954198473282, 'fraction_numerical': 0.00732824427480916, 'mean_word_length': 2.8137369033760185, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, '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': '6644849', 'n_tokens_mistral': 900, 'n_tokens_neox': 869, 'n_words': 269}