package com.janosgyerik.tools.util;

import java.util.Arrays;

public class MatrixUtils {

    private MatrixUtils() {
        // utility class, forbidden constructor
    }

    public static String toString(int[][] matrix) {
        StringBuilder builder = new StringBuilder();
        builder.append("[");
        if (matrix.length > 0) {
            builder.append(Arrays.toString(matrix[0]));
            for (int i = 1; i < matrix.length; ++i) {
                builder.append(", ").append(Arrays.toString(matrix[i]));
            }
        }
        builder.append("]");
        return builder.toString();
    }
}

@@ -56,16 +56,63 @@
 rrays;%0A%0A
+/**%0A * Utility class to work with matrices%0A */%0A
 public c
@@ -214,16 +214,178 @@
 %0A    %7D%0A%0A
+    /**%0A     * Format matrix as String, by joining Arrays.toString of each row%0A     * @param matrix the matrix to format%0A     * @return the matrix String%0A     */%0A
     publ

Add documentation for public class and method