package ru.job4j;

/**
 * Created by ANTON on 27.05.2017.
 */
public class ReverseArrayTest {
}

@@ -16,81 +16,1948 @@
 j;%0A%0A
+import java.util.*;%0Aimport org.junit.Test;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0A
 /**
+.
 %0A * C
-reated by ANTON on 27.05.2017.%0A */%0Apublic class ReverseArrayTest %7B
+hapter_003%0A * Task 3.1.3%0A * Test transform collection to array and back%0A *%0A * @author Anton Vasilyuk%0A * @version 1.0%0A * @since 0.1%0A */%0Apublic class ReverseArrayTest %7B%0A    /**.%0A     * Test method transform array to collection%0A     */%0A    @Test%0A    public void whenNeedTransformArrayToCollectionThenDoIt() %7B%0A        ReverseArray reverseArray = new ReverseArray();%0A        int%5B%5D%5B%5D array = %7B%7B1, 2, 3%7D, %7B4, 5, 6%7D, %7B7, 8, 9%7D%7D;%0A        List%3CInteger%3E list = reverseArray.toList(array);%0A        List%3CInteger%3E listSecond = new LinkedList%3C%3E();%0A        listSecond.add(1);%0A        listSecond.add(2);%0A        listSecond.add(3);%0A        listSecond.add(4);%0A        listSecond.add(5);%0A        listSecond.add(6);%0A        listSecond.add(7);%0A        listSecond.add(8);%0A        listSecond.add(9);%0A        boolean fact = false;%0A        if (list.containsAll(listSecond)) %7Bfact = true;%7D%0A        boolean expect = true;%0A        assertThat(fact, is(expect));%0A    %7D%0A%0A    /**.%0A     * Test transform collection to array%0A     */%0A    @Test%0A    public void whenNeedTransformCollectionToArrayThenDoIt() %7B%0A        ReverseArray reverseArray = new ReverseArray();%0A        List%3CInteger%3E list = new LinkedList%3C%3E();%0A        list.add(1);%0A        list.add(2);%0A        list.add(3);%0A        list.add(4);%0A        list.add(5);%0A        list.add(6);%0A        list.add(7);%0A        int%5B%5D%5B%5D array = reverseArray.toArray(list, 3);%0A        int%5B%5D%5B%5D arraySecond = %7B%7B1, 2, 3%7D, %7B4, 5, 6%7D, %7B7, 0, 0%7D%7D;%0A        boolean fact = true;%0A        boolean expect = true;%0A        for (int i = 0; i %3C array.length; i++) %7B%0A            for (int j = 0; j %3Carray.length;j++) %7B%0A                if (array%5Bi%5D%5Bj%5D != arraySecond%5Bi%5D%5Bj%5D) %7B%0A                    fact = false;%0A                    break;%0A                %7D%0A            %7D%0A        %7D%0A        assertThat(fact, is(expect));%0A    %7D
 %0A%7D%0A

add file for chapter_003_3.1.3