code: public void setCapacity(long capacity) {
          checkArgument(capacity >= 0);
          evictionLock.lock();
          try {
              this.capacity = Math.min(capacity, MAXIMUM_CAPACITY);
              drainBuffers();
              evict();
          } finally {
              evictionLock.unlock();
          }
          notifyListener();
      }
docs: Sets the maximum weighted capacity of the map and eagerly evicts entries
  until it shrinks to the appropriate size.
  
  @param capacity the maximum weighted capacity of the map
  @throws IllegalArgumentException if the capacity is negative