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);
    }
@Test
    void shouldRemovePresentElementAtEnd()
    {
        final Integer[] result = ArrayUtil.remove(values, TWO);

        assertArrayEquals(new Integer[]{ ONE }, result);
    }