code: @GuardedBy("evictionLock")
    void setMaximumSize(long maximum) {
      requireArgument(maximum >= 0);
      if (maximum == maximum()) {
        return;
      }
  
      long max = Math.min(maximum, MAXIMUM_CAPACITY);
      long window = max - (long) (PERCENT_MAIN * max);
      long mainProtected = (long) (PERCENT_MAIN_PROTECTED * (max - window));
  
      setMaximum(max);
      setWindowMaximum(window);
      setMainProtectedMaximum(mainProtected);
  
      setHitsInSample(0);
      setMissesInSample(0);
      setStepSize(-HILL_CLIMBER_STEP_PERCENT * max);
  
      if ((frequencySketch() != null) && !isWeighted() && (weightedSize() >= (max >>> 1))) {
        // Lazily initialize when close to the maximum size
        frequencySketch().ensureCapacity(max);
      }
    }
docs: Sets the maximum weighted size of the cache. The caller may need to perform a maintenance cycle
  to eagerly evicts entries until the cache shrinks to the appropriate size.