code: public static String getSetContents(Set s) {
          StringBuffer sb = new StringBuffer(1000);
  
          Object[] sortedArray = s.toArray();
          Arrays.sort(sortedArray);
  
          int counter = 0;
          int elementsPerRow = 10;
          for (Object element : sortedArray) {
              sb.append(element.toString() + " ");
              counter++;
              if ((counter % elementsPerRow) == 0) {
                  sb.append(System.getProperty("line.separator"));
              }
          }
          sb.append(System.getProperty("line.separator"));
          return sb.toString();
      }
docs: Debug output an internal set structure.
  @param s Must not be {@code null}.
  @return The resulting String of the contents of {@code s}.