A single and multi-level cache implemented in Java