code: public static <T> T[] remove(final T[] oldElements, final T elementToRemove)
      {
          final int length = oldElements.length;
          int index = UNKNOWN_INDEX;
  
          for (int i = 0; i < length; i++)
          {
              if (oldElements[i] == elementToRemove)
              {
                  index = i;
              }
          }
  
          return remove(oldElements, index);
      }
docs: Remove an element from an array resulting in a new array if the element was found otherwise the old array.
  <p>
  Returns its input parameter if the element to remove isn't a member.
  
  @param oldElements     to have the element removed from.
  @param elementToRemove being searched for by identity semantics.
  @param <T>             type of the array.
  @return a new array without the element if found otherwise the original array.