public short[] getKeys() {
        short[] keyArray = new short[getSize()];
        int pos = 0;

        short nLists = indexer.getNumLists();
        for(short i=0;i<nLists;i++) {
            short keyIndex = indexer.first(i);
            while(keyIndex >= 0) {
                keyArray[pos++] = keys[keyIndex];
                keyIndex = indexer.next(keyIndex);
            }
        }
        if (pos != getSize()) {
            throw new AssertException("Trouble in IntKeyIndexer.getKeys(), size = "+
                getSize()+"  pos= "+pos);
        }
        return keyArray;
    }
Returns an array containing all the keys stored in this object.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/ShortKeyIndexer.java