private void grow() {

        short newCapacity = (short)Prime.nextPrime(indexer.getNewCapacity());
        indexer.growCapacity(newCapacity);
        indexer.growNumLists(newCapacity);
        indexer.clear();

		short[] oldKeys = keys;
        keys = new short[newCapacity];
        capacity = newCapacity;
		for(short i=0;i<oldKeys.length;i++) {
			put(oldKeys[i]);
		}
    }
Increases the size of the keys array and the indexer.
 This method needs to be very careful!  It is very important that the keys get
 mapped to the same key index even though they are stored in a different list
 in the indexer class (Which is indexed based on the hashcode (mod capacity) of
 the key.  Since this method can only be called when the indexer is full, we
 can assume that there are no gaps (freed indexes) in the keys array.  Therefore,
 if we clear everything and add them back in the same order that they were stored
 in the old keys array, they should be assigned the same index.  This is important
 since other containing classes may be storing lots of information based on this
 index and we don't want the indexing to change just because we had to grow.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/ShortKeyIndexer.java