if (null == array) return "null";
   public static String collapseArray(Object array)   {      if (array.getClass().isArray()) {         String s = "{ ";         for (int i = 0; i < Array.getLength(array); i++)            s += collapseArray(Array.get(array, i))+",";         s = s.replaceAll(".$"," }");         return s;      } else if (array instanceof List) {         String s = "{ ";         for (Object o: (List) array)            s += collapseArray(o)+",";         s = s.replaceAll(".$"," }");         return s;      } else if (array instanceof Map) {         String s = "{ ";         for (Object o: ((Map) array).keySet())            s += collapseArray(o)+" => "+collapseArray(((Map) array).get(o))+",";         s = s.replaceAll(".$"," }");         return s;      } else return array.toString();   }