int addInternal(Element newElement, Element[] addElements) {
        int slot = slot(addElements, newElement);
        for (int seen = 0; seen < addElements.length; seen++) {
            Element element = addElements[slot];
            if (element == null) {
                addElements[slot] = newElement;
                return slot;
            }
            if (element.elementKeysAreEqual(newElement)) {
                return INVALID_INDEX;
            }
            slot = (slot + 1) % addElements.length;
        }
        throw new RuntimeException("Not enough hash table slots to add a new element.");
    }
Adds a new element to the appropriate place in the elements array.

@param newElement    The new element to add.
@param addElements   The elements array.
@return              The index at which the element was inserted, or INVALID_INDEX
                     if the element could not be inserted.
clients/src/main/java/org/apache/kafka/common/utils/ImplicitLinkedHashCollection.java