Here you can find the source of matrixToString(String[][] m)
private static String matrixToString(String[][] m)
//package com.java2s; //License from project: BSD License public class Main { private static String matrixToString(String[][] m) { StringBuilder expectedStr = new StringBuilder(); expectedStr.append("{"); for (String[] strings : m) { expectedStr.append("{"); for (String s : strings) { expectedStr.append('"'); expectedStr.append(s);/*from w ww . j ava 2 s .c o m*/ expectedStr.append('"'); expectedStr.append(','); } expectedStr.deleteCharAt(expectedStr.length() - 1); expectedStr.append("},"); } expectedStr.deleteCharAt(expectedStr.length() - 1); expectedStr.append("}"); return expectedStr.toString(); } }