code: public static <T> T[] add(final T[] oldElements, final T elementToAdd)
      {
          final int length = oldElements.length;
          final T[] newElements = Arrays.copyOf(oldElements, length + 1);
          newElements[length] = elementToAdd;
  
          return newElements;
      }
docs: Add an element to an array resulting in a new array.
  
  @param oldElements  to have the new element added.
  @param elementToAdd for the new array.
  @param <T>          type of the array.
  @return a new array that is one bigger and containing the new element at the end.