### How can I convert Pair to 2 dimensional array in JAVA?

Is there a simpler approach by which I can convert Pair to 2 dimensional array? Here is what I have tried: List<Pair<Integer, Integer>> pairs = new ArrayList<>(); //this is example value pairs.add(new Pair<>(1,2)); pairs.add(new Pair<>(2,3)); pairs.add(new Pair<>(3,4)); //I want to make array same size of pair’s int[][] arr = new int[pairs.size()][2]; for(int i =0 ;…

Details