Fast Flexible efficient in memory LRU Java cache This repository has the sources to my post.
Barak.
Sample Usage:
Cache<String, byte[]> fileContentCache =
new Cache<>(key -> readFileContent(new File(key)), 10);
See example
Maven dependency
<dependency>
<groupId>com.github.barakb</groupId>
<artifactId>concurrent-cache</artifactId>
<version>1.0</version>
</dependency>