code: public static Object newHashTable(int numEntries, float loadFactor) {
  
          int hashSize = (int) Math.ceil((float) numEntries / loadFactor);
          hashSize = 1 << (32 - Integer.numberOfLeadingZeros(hashSize)); // next
                                                                         // power
                                                                         // of 2
  
          if (numEntries < 256) {
              byte hashTable[] = new byte[hashSize];
              Arrays.fill(hashTable, (byte) -1);
              return hashTable;
          }
  
          if (numEntries < 65536) {
              short hashTable[] = new short[hashSize];
              Arrays.fill(hashTable, (short) -1);
              return hashTable;
          }
  
          int hashTable[] = new int[hashSize];
          Arrays.fill(hashTable, -1);
          return hashTable;
      }
docs: /*
  The number of entries will determine the size of the hash table elements.
  
  If the entry index can be always represented in 8 bits, the hash table
  will be byte[] If the entry index can always be represented in 16 bits,
  the hash table will be short[] Otherwise, the hash table will be int[].
  
  The sign bit is used for byte[] and short[] hash tables, but the value -1
  is reserved to mean "empty".
  
  Because the entries[] array stores both keys and values, the key for
  entry "n" will be stored at entries[n*2]. "n" is the value stored in the
  hash table.