swapRows(test, 0, 2); System.out.println("\nAfter swapping row 0 and 2:"); print2D(test);

, and I'll write the complete code solution for you.