<commit_before>package ru.pravvich.iterator_lessons.even_iterator;

import org.junit.Test;

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

public class EvenIteratorTest {
    @Test
    public void whenHasNextReturnTrueThenIteratorGetEvenNumbers() {
        Integer[] numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
        EvenIterator<Integer> evenIterator = new EvenIterator<>(numbers);

        Integer[] result = new Integer[5];
        int i = 0;
        while (evenIterator.hasNext()) {
            result[i++] = evenIterator.next();
        }

        assertThat(result, is(new Integer[]{2, 4, 6, 8, 10}));
    }
}<commit_msg>add even iterator test<commit_after>package ru.pravvich.iterator_lessons.even_iterator;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;

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

public class EvenIteratorTest {
    @Test
    public void whenHasNextReturnTrueThenIteratorGetEvenNumbers() {
        Integer[] numbers = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
        EvenIterator<Integer> evenIterator = new EvenIterator<>(numbers);

        Integer[] result = new Integer[5];
        int i = 0;
        while (evenIterator.hasNext()) {
            result[i++] = evenIterator.next();
        }

        assertThat(result, is(new Integer[]{2, 4, 6, 8, 10}));
    }

    @Test
    public void whenArrayToNumberNotContentEvenNumberThenReturnArrayZeroLength() {
        Integer[] numbers = {0, 1,};
        EvenIterator<Integer> evenIterator = new EvenIterator<>(numbers);

        List<Integer> list = new ArrayList<>();
        while (evenIterator.hasNext()) {
            list.add(evenIterator.next());
        }

        assertThat(list.size(), is(0));
    }
}
{'fraction_non_alphanumeric': 0.13370786516853933, 'fraction_numerical': 0.026404494382022473, 'mean_word_length': 3.0112612612612613, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7155225', 'n_tokens_mistral': 584, 'n_tokens_neox': 537, 'n_words': 134}