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}));
    }
}
@@ -70,16 +70,68 @@
 .Test;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import s
@@ -678,10 +678,405 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void whenArrayToNumberNotContentEvenNumberThenReturnArrayZeroLength() %7B%0A        Integer%5B%5D numbers = %7B0, 1,%7D;%0A        EvenIterator%3CInteger%3E evenIterator = new EvenIterator%3C%3E(numbers);%0A%0A        List%3CInteger%3E list = new ArrayList%3C%3E();%0A        while (evenIterator.hasNext()) %7B%0A            list.add(evenIterator.next());%0A        %7D%0A%0A        assertThat(list.size(), is(0));%0A    %7D
 %0A%7D

add even iterator test