public void resize(int maxSize) {
        if (maxSize <= 0) {
            throw new IllegalArgumentException("maxSize <= 0");
        }

        synchronized (this) {
            this.maxSize = maxSize;
        }
        trimToSize(maxSize);
    }
Sets the size of the cache.

@param maxSize The new maximum size.
android/android_framework/base/src/main/java/github/tornaco/android/thanos/core/util/collection/LruCache.java