code: @SuppressWarnings("unchecked")
    public <E extends T> T[] concat(T[] oldArray, E newElement) {
      T[] arr = (T[]) Array.newInstance(type, oldArray.length + 1);
      System.arraycopy(oldArray, 0, arr, 0, oldArray.length);
      arr[oldArray.length] = newElement;
      return  arr;
    }
docs: Returns a new instance with the given element at the end.
  
  @param oldArray the old array
  @param newElement the element to contatenate
  @param <E> the element type
  @return a new array