private List doReturn(int minSize, int maxSize) {
    acquireReadLock();
    try {
      int numToReturn = idsAvailable.size();
      if (numToReturn < minSize) {
        return null;
      }
      if (numToReturn > maxSize) {
        numToReturn = maxSize;
      }
      return getBatchAndUpdateThreadContext(numToReturn);
    } finally {
      releaseReadLock();
    }

  }
Return a batch of minimum specified size

@param minSize minimum number to return
@return null if minimum was not present
geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java