void addKey(short key) {
        if ((keySet.size() == switchSize) && indexer != null) {
            DataTable newTable = new DataTable();
            short oldKey = keySet.getFirst();
            while(oldKey != -1) {
                table.copyRowTo(indexer.get(oldKey), newTable, oldKey);
                oldKey = keySet.getNext(oldKey);
            }
            indexer = null;
            table = newTable;
        }


		if(keySet.size() == threshold) {
			if(keySet instanceof RedBlackKeySet) {
				// switch to BitTree
				BitTree newKeySet = new BitTree((short)(pageSize-1));
				short oldKey = keySet.getFirst();

				while(oldKey != -1) {
					newKeySet.put(oldKey);
					oldKey = keySet.getNext(oldKey);
				}
				keySet = newKeySet;
			}
		}
		keySet.put(key);
        if (keySet.size() == pageSize) {
            // we may already have a FullKeySet
            if(!(keySet instanceof FullKeySet)) {
                keySet = new FullKeySet(pageSize);
            }
        }


	}
Adds the key to the keySet. If all values are set,
use FullBitSet.
@param key The key to be added to the set.
Ghidra/Framework/Generic/src/main/java/ghidra/util/map/ValueStoragePage.java