public int getListSize(int listID) {

        if ((listID < 0) || (listID >= numLists)) {
            throw new IndexOutOfBoundsException("The listID is out of bounds");
        }

        int count = 0;
        int p = heads[listID];
        while(p != END_OF_LIST) {
            count++;
            p = links[p];
        }
        return count;
    }
Returns the number of indexes in the specified list.
@param listID the id of the list from which to get the number of indexes.
@exception IndexOutOfBoundsException thrown if the listID is not in the
the range [0, numLists).
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/IntListIndexer.java