A single and multilevel cache implemented in Java