/** {@inheritDoc} */
  @Override
  protected void rehash(int newCapacity) {
    int oldCapacity = capacity();

    TCharOffheapArray oldKeys = _set;
    TCharOffheapArray oldVals = _values;
    TByteOffheapArray oldStates = _states;

    _set = new TCharOffheapArray(newCapacity);
    _values = new TCharOffheapArray(newCapacity);
    _states = new TByteOffheapArray(newCapacity);

    for (int i = oldCapacity; i-- > 0; ) {
      if (oldStates.get(i) == FULL) {
        char o = oldKeys.get(i);
        int index = insertKey(o);
        _values.put(index, oldVals.get(i));
      }
    }
    oldKeys.free();
    oldVals.free();
    oldStates.free();
  }