@Override
    public boolean equals(Object object)
    {
        if (object == this)
        {
            return true;
        }
        if (!(object instanceof ArrayList<?>))
        {
            return false;
        }
        ArrayList<?> arrayList = (ArrayList<?>)object;
        if (size != arrayList.size)
        {
            return false;
        }
        for (int i = 0; i < size; ++i)
        {
            if (!elements[i].equals(arrayList.elements[i]))
            {
                return false;
            }
        }
        return true;
    }