public static String toString(Collection<?> collection) {
    List<String> stringList = new ArrayList<>();
    for (Object o : collection) {
      stringList.add(Objects.toString(o));
    }
    return "[" + String.join(",", stringList) + "]";
  }
Pretty prints a collection of any type to a string. Relies on toString() implementation of the
object type.
@param collection collection to pretty print.
@return Pretty printed string for the collection.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java