private void trim(List<File> files) {
        long totalSize = countTotalSize(files);
        int totalCount = files.size();
        for (File file : files) {
            boolean accepted = accept(file, totalSize, totalCount);
            if (!accepted) {
                long fileSize = file.length();
                boolean deleted = file.delete();
                if (deleted) {
                    totalCount--;
                    totalSize -= fileSize;
                    Logger.info("Cache file " + file + " is deleted because it exceeds cache limit");
                } else {
                    Logger.error("Error deleting file " + file + " for trimming cache");
                }
            }
        }
    }
{@link DiskUsage} that uses LRU (Least Recently Used) strategy to trim cache.
VideoCache/src/main/java/com/yc/videocache/file/LruDiskUsage.java