code: public static <T> T[] add(final T[] a, final T element) {
          N.checkArgNotNull(a, "a");
  
          if (N.isNullOrEmpty(a)) {
              return N.asArray(element);
          }
  
          final T[] newArray = (T[]) Array.newInstance(a.getClass().getComponentType(), a.length + 1);
  
          copy(a, 0, newArray, 0, a.length);
          newArray[a.length] = element;
  
          return newArray;
      }
docs: <p>
  Copies the given array and adds the given element at the end of the new
  array.
  
  @param a
  @param element
  @return A new array containing the existing elements plus the new element
  @throws NullPointerException if the specified <code>a</code> is <code>null</code>.