int findSlab(long addr) {
    for (int i = 0; i < slabs.length; i++) {
      Slab slab = slabs[i];
      long slabAddr = slab.getMemoryAddress();
      if (addr >= slabAddr) {
        if (addr < slabAddr + slab.getSize()) {
          return i;
        }
      }
    }
    throw new IllegalStateException("could not find a slab for addr " + addr);
  }
newSlabs will be non-null in unit tests. If the unit test gave us a different array of slabs
then something is wrong because we are trying to reuse the old already allocated array which
means that the new one will never be used. Note that this code does not bother comparing the
contents of the arrays.
geode-core/src/main/java/org/apache/geode/internal/offheap/FreeListManager.java