docs: private static int findInsertionIndex(final long[] keys, final byte[] states,
                                            final long key, final int mask) {
          final int hash = hashOf(key);
          int index = hash & mask;
          if (states[index] == FREE) {
              return index;
          } else if (states[index] == FULL && keys[index] == key) {
              return changeIndexSign(index);
          }
  
          int perturb = perturb(hash);
          int j = index;
          if (states[index] == FULL) {
              while (true) {
                  j = probe(perturb, j);
                  index = j & mask;
                  perturb >>= PERTURB_SHIFT;
  
                  if (states[index] != FULL || keys[index] == key) {
                      break;
                  }
              }
          }
  
          if (states[index] == FREE) {
              return index;
          } else if (states[index] == FULL) {
              // due to the loop exit condition,
              // if (states[index] == FULL) then keys[index] == key
              return changeIndexSign(index);
          }
  
          final int firstRemoved = index;
          while (true) {
              j = probe(perturb, j);
              index = j & mask;
  
              if (states[index] == FREE) {
                  return firstRemoved;
              } else if (states[index] == FULL && keys[index] == key) {
                  return changeIndexSign(index);
              }
  
              perturb >>= PERTURB_SHIFT;
  
          }
  
      }