public static String toString(int[] a) {
if (a == null)
return "null";
int iMax = a.length - 1;
if (iMax == -1)
return "[]";
StringBuilder b = new StringBuilder();
b.append('[');
for (int i = 0;i<a.length ; i++) {
if (i == iMax ){
b.append(a[i]).append("]");
}else {
b.append(a[i]).append(", ");
}