docs: private void ensureSize() {
  
        while (true) {
           long addressToRemove;
           Lock entryWriteLock;
           OffHeapConcurrentMap map;
           lruLock.lock();
           try {
              if (currentSize <= maxSize) {
                 break;
              }
              // We shouldn't be able to get into this state
              assert firstAddress > 0;
              // We read the key before hashCode due to how off heap bytes are written (key requires reading metadata
              // which comes before hashCode, which should keep hashCode bytes in memory register in most cases)
              byte[] key = offHeapEntryFactory.getKey(firstAddress);
  
              map = getMapThatContainsKey(key);
              if (map != null) {
                 int hashCode = offHeapEntryFactory.getHashCode(firstAddress);
                 // This is always non null
                 entryWriteLock = map.getLocks().getLockFromHashCode(hashCode).writeLock();
                 if (entryWriteLock.tryLock()) {
                    addressToRemove = firstAddress;
                 } else {
                    addressToRemove = 0;
                 }
              } else {
                 // We have to loop back around - more than likely the concurrent removal of a segment probably reduced
                 // the max size so we probably don't have to worry
                 continue;
              }
           } finally {
              lruLock.unlock();
           }
  
           // If we got here it means we were unable to acquire the write lock, so we have to attempt a blocking
           // write lock and then acquire the lruLock, since they have to be acquired in that order (exception using
           // try lock as above)
           if (addressToRemove == 0) {
              entryWriteLock.lock();
              try {
                 lruLock.lock();
                 try {
                    if (currentSize <= maxSize) {
                       break;
                    }
                    // Now that we have locks we have to verify the first address is protected by the same lock still
                    byte[] key = offHeapEntryFactory.getKey(firstAddress);
  
                    OffHeapConcurrentMap protectedMap = getMapThatContainsKey(key);
                    if (protectedMap == map) {
                       int hashCode = offHeapEntryFactory.getHashCode(firstAddress);
                       Lock innerLock = map.getLocks().getLockFromHashCode(hashCode).writeLock();
                       if (innerLock == entryWriteLock) {
                          addressToRemove = firstAddress;
                       }
                    }
                 } finally {
                    lruLock.unlock();
                 }
              } finally {
                 if (addressToRemove == 0) {
                    entryWriteLock.unlock();
                 }
              }
           }
  
           if (addressToRemove != 0) {
              if (trace) {
                 log.tracef("Removing entry: 0x%016x due to eviction due to size %d being larger than maximum of %d",
                       addressToRemove, currentSize, maxSize);
              }
              try {
                 InternalCacheEntry<WrappedBytes, WrappedBytes> ice = offHeapEntryFactory.fromMemory(addressToRemove);
                 map.remove(ice.getKey(), addressToRemove);
                 CompletionStage<Void> passivationStage = passivator.running().passivateAsync(ice);
                 CompletionStage<Void> evictionStage = evictionManager.onEntryEviction(Collections.singletonMap(ice.getKey(), ice));
                 CompletionStages.join(CompletionStages.allOf(passivationStage, evictionStage));
              } finally {
                 entryWriteLock.unlock();
              }
           }
        }
     }