public int getPositionOfItemInSection(int sectionIndex, int adapterPosition) {
        if (sections == null) {
            buildSectionIndex();
        }

        if (sectionIndex < 0) {
            throw new IndexOutOfBoundsException("sectionIndex " + sectionIndex + " < 0");
        }

        if (sectionIndex >= sections.size()) {
            throw new IndexOutOfBoundsException("sectionIndex " + sectionIndex + " >= sections.size (" + sections.size() + ")");
        }

        Section section = this.sections.get(sectionIndex);
        int localPosition = adapterPosition - section.adapterPosition;
        if (localPosition > section.length) {
            throw new IndexOutOfBoundsException("adapterPosition: " + adapterPosition + " is beyond sectionIndex: " + sectionIndex + " length: " + section.length);
        }

        if (section.hasHeader) {
            // adjust for header and ghostHeader
            localPosition -= 2;
        }

        return localPosition;
    }
Given a sectionIndex and an adapter position get the local position of an item relative to the sectionIndex,
where the first item has position 0

@param sectionIndex    the sectionIndex index
@param adapterPosition the adapter adapterPosition
@return the position relative to the sectionIndex of an item in that sectionIndex
<p/>
Note, if the adapterPosition corresponds to a sectionIndex header, this will return -1
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/section/SectioningAdapter.java