Write a static method that takes as a parameter an Array Lis…
Write a static method that takes as a parameter an Array List of Integer and returns a 2D array. Given this ArrayList: The first number in the list will represent the number of rows : 3 The second number in the list will represent the number of cols : 7 The method will make a 2D array with 3 rows and 7 columns, filling one row at a time. 1 2 3 4 6 6 7 8 9 10 11 12 13 14 15 16 17 -1 -1 -1 -1 Because there were not enough numbers in the ArrayList, the remaining spots in the 2D array will be filled with the value -1. Given this ArrayList: The first number in the list will represent the number of rows : 2 The second number in the list will represent the number of cols : 3 The method will make a 2D array with 2 rows and 3 columns, filling one row at a time. 8 6 1 5 4 7 Because there were too many numbers in the ArrayList, the extra values in the list will not be placed in the 2D array. Note: If the ArrayList has a .size() less than 2, the method should return null. You may want to use some of these ArrayList methods: .size(), .get(i), .remove(i), Important: You will be graded on proper indentation which must be used after the method header, loops, if, and else statements. In addition, all } must appear on a line by themselves. If you want, you may use bullet lists in the Canvas editor. Type this header into your answer, and then complete the method: public static int process(ArrayList list) {