@Override
    public final boolean add(E newElement) {
        if (newElement == null) {
            return false;
        }
        if (newElement.prev() != INVALID_INDEX || newElement.next() != INVALID_INDEX) {
            return false;
        }
        if ((size + 1) >= elements.length / 2) {
            changeCapacity(calculateCapacity(elements.length));
        }
        int slot = addInternal(newElement, elements);
        if (slot >= 0) {
            addToListTail(head, elements, slot);
            size++;
            return true;
        }
        return false;
    }
Add a new element to the collection.

@param newElement    The new element.

@return              True if the element was added to the collection;
                     false if it was not, because there was an existing equal element.
clients/src/main/java/org/apache/kafka/common/utils/ImplicitLinkedHashCollection.java