code: public static String arrayToDelimitedString(Object[] arr, String delim) {
          if (Objects.isEmpty(arr)) {
              return "";
          }
          if (arr.length == 1) {
              return Objects.nullSafeToString(arr[0]);
          }
          StringBuilder sb = new StringBuilder();
          for (int i = 0; i < arr.length; i++) {
              if (i > 0) {
                  sb.append(delim);
              }
              sb.append(arr[i]);
          }
          return sb.toString();
      }
docs: Convenience method to return a String array as a delimited (e.g. CSV)
  String. E.g. useful for <code>toString()</code> implementations.
  @param arr the array to display
  @param delim the delimiter to use (probably a ",")
  @return the delimited String