Let’s revisit the cache implementation for storing frequently searched programs. One strategy to implement fixed size cache is to maintain the search count for each program and when the cache size is more than maximum allowed size, delete the programs which are least frequently searched. The
ProgramSearchResult class uses variable of type
AtomicInteger to store the search count.