<commit_before>package ru.job4j.pro.set;

import org.junit.Test;

import java.util.Iterator;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Class ArraySetContainerTest.
 *
 * @author <NAME>
 * @version $1.0$
 * @since 01.07.2017
 */
public class ArraySetContainerTest {
    /**
     * Test add method und iterator.
     */
    @Test
    public void whenAddElementsThenGetWithIterator() {
        ArraySetContainer<Integer> set = new ArraySetContainer<>(2);
        Integer[] arrInt = {100, 200, 200, 300, 400};

        for (Integer ival : arrInt) {
            set.add(ival);
        }

        Integer[] expected = {100, 200, 300, 400};
        Iterator itr = set.iterator();
        int ind = 0;
        while (itr.hasNext()) {
            assertThat(itr.next(), is(expected[ind++]));
        }
    }
}<commit_msg>Исправления<commit_after>package ru.job4j.pro.set;

import org.junit.Test;
import java.util.ConcurrentModificationException;
import java.util.Iterator;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Class ArraySetContainerTest.
 *
 * @author <NAME>
 * @version $1.0$
 * @since 01.07.2017
 */
public class ArraySetContainerTest {
    /**
     * Test add method und iterator.
     */
    @Test
    public void whenAddElementsThenGetWithIterator() {
        ArraySetContainer<Integer> set = new ArraySetContainer<>(4);
        //Integer[] arrInt = {100, 200, 300, 400};
        set.add(1);
        set.add(2);
        set.add(3);
        set.add(4);
        /*for (Integer ival : arrInt) {
            set.add(ival);
        }*/

        Integer[] expected = {1, 2, 3, 4};
        Iterator itr = set.iterator();
        assertThat(itr.next(), is(4));
/*        int ind = 0;

        while (itr.hasNext()) {
            assertThat(itr.next(), is(expected[ind++]));
        }*/
    }
}
{'fraction_non_alphanumeric': 0.1469496021220159, 'fraction_numerical': 0.039257294429708225, 'mean_word_length': 2.3920863309352516, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4333725', 'n_tokens_mistral': 657, 'n_tokens_neox': 607, 'n_words': 135}