code: public static String join(String[] array, String separator) {
          if (array == null || array.length == 0) {
              return "";
          }
          if (array.length == 1) {
              return array[0] == null ? "null" : array[0];
          }
  
          StringBuilder buf = new StringBuilder();
          buf.append(array[0]);
          for (int i = 1; i < array.length; i++) {
              buf.append(separator).append(array[i]);
          }
          return buf.toString();
      }
docs: Joins all elements of an array into a string.
  <p><strong>Implementation Note</strong>: The specification does not define what happens when
  elements in the array are null. For compatibility with previous implementations, the string
  "null" is used although EL conventions would suggest an empty string might be better.
  
  @param array     an array of strings to be joined
  @param separator used to separate the joined strings
  @return all array elements joined into one string with the specified separator