import org.junit.Test;

import static org.junit.Assert.*;

public class Q6Test {

    interface RotateMatrix90 {
        void rotate90(int[][] mat);
    }

    public void testRotateMatrix90(RotateMatrix90 rotateMatrix90) {
        int[][] inputMatrix = {
                {1,2,3},
                {4,5,6},
                {7,8,9}};
        int[][] outputMatrix = {
                {3,6,9},
                {2,5,8},
                {1,4,7}};
        int[][] expectedOutputMatrix = {
                {1,2,3},
                {4,5,6},
                {7,8,9}};

        rotateMatrix90.rotate90(outputMatrix);

        System.out.println("Input:");
        printMatrix(inputMatrix);
        System.out.println();
        System.out.println();

        System.out.println("Expected output:");
        printMatrix(expectedOutputMatrix);
        System.out.println();
        System.out.println();

        System.out.println("Output:");
        printMatrix(outputMatrix);
        System.out.println();
        System.out.println();

        assertArrayEquals(expectedOutputMatrix, outputMatrix);
    }

    @Test
    public void testRotateMatrix90_InPlace() throws Exception {
        testRotateMatrix90(Q6::rotateMatrix90_InPlace);
    }

    private static void printMatrix(int[][] a) {
        for (int[] row : a) {
            for (int col : row) {
                System.out.print(col + " ");
            }
            System.out.println();
        }
    }

}
@@ -1,12 +1,48 @@
+import CtCILibrary.AssortedMethods;%0A
 import org.j
@@ -52,16 +52,16 @@
 t.Test;%0A
-
 %0Aimport 
@@ -674,32 +674,48 @@
 put:%22);%0A        
+AssortedMethods.
 printMatrix(inpu
@@ -833,32 +833,48 @@
 put:%22);%0A        
+AssortedMethods.
 printMatrix(expe
@@ -1000,16 +1000,32 @@
         
+AssortedMethods.
 printMat
@@ -1248,16 +1248,16 @@
 ption %7B%0A
+
         
@@ -1315,228 +1315,5 @@
  %7D%0A%0A
-    private static void printMatrix(int%5B%5D%5B%5D a) %7B%0A        for (int%5B%5D row : a) %7B%0A            for (int col : row) %7B%0A                System.out.print(col + %22 %22);%0A            %7D%0A            System.out.println();%0A        %7D%0A    %7D%0A%0A
 %7D

Use library to print matrices.