code: public synchronized void setCapacity(int capacity) {
          BitmapLRUCache lruCacheNew = new BitmapLRUCache(capacity);
          lruCacheNew.putAll(this.lruCache);
          this.lruCache = lruCacheNew;
      }
docs: Sets the new size of this cache. If this cache already contains more items than the new capacity allows, items
  are discarded based on the cache policy.
  
  @param capacity the new maximum number of entries in this cache.
  @throws IllegalArgumentException if the capacity is negative.