package ru.matevosyan;

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

public class ConvertList {

    public List<Integer> toList (int[][] array) {
        List<Integer> list = new ArrayList<>();
        for (int[] anArray : array) {
            for (int j = 0; j < array.length; j++) {
                list.add(anArray[j]);
            }
        }
        return list;
    }

    public int[][] toArray (List<Integer> list, int rows) {

        int column = list.size() % rows == 0 ? list.size() / rows : list.size() / rows + 1;

        int[][] array = new int[rows][column];

        Iterator<Integer> iterator = list.iterator();

        for (int j = 0; j < rows; j++) {
            for (int i = 0; i < column && iterator.hasNext(); i++) {
                array[j][i] = iterator.next();
            }

        }

        return  array;
    }

}

@@ -120,24 +120,435 @@
 vertList %7B%0A%0A
+    public List%3CInteger%3E convert (List%3Cint%5B%5D%3E list) %7B%0A        Iterator iterator = list.listIterator();%0A        ArrayList%3CInteger%3E arrayList = new ArrayList%3C%3E();%0A        int%5B%5D arrList;%0A        while (iterator.hasNext()) %7B%0A            arrList = (int%5B%5D) iterator.next();%0A            for (int anArrList : arrList) %7B%0A                arrayList.add(anArrList);%0A            %7D%0A        %7D%0A        return arrayList;%0A    %7D%0A%0A
     public L

add convert method