docs: @Override
    public synchronized void relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)
    {
      DoublesUnion union = unions.get(oldBuffer).get(oldPosition);
      final WritableMemory oldMem = getMemory(oldBuffer).writableRegion(oldPosition, maxIntermediateSize);
      if (union.isSameResource(oldMem)) { // union was not relocated on heap
        final WritableMemory newMem = getMemory(newBuffer).writableRegion(newPosition, maxIntermediateSize);
        union = DoublesUnion.wrap(newMem);
      }
      putUnion(newBuffer, newPosition, union);
  
      Int2ObjectMap<DoublesUnion> map = unions.get(oldBuffer);
      map.remove(oldPosition);
      if (map.isEmpty()) {
        unions.remove(oldBuffer);
        memCache.remove(oldBuffer);
      }
    }