IndexableChunkCache { public Buffer get(String path) { Buffer r = cache.getIfPresent(path); if (r != null) { cache.invalidate(path); } return r; } IndexableChunkCache();   IndexableChunkCache(long maximumSize, long maximumTime); static IndexableChunkCache getInstance(); void put(String path, Buffer chunk); Buffer get(String path); long getSize(); long getNumberOfChunks();  }
@Test public void get(TestContext ctx) { IndexableChunkCache c = new IndexableChunkCache(); String path = "path"; Buffer chunk = Buffer.buffer("CHUNK"); c.put(path, chunk); ctx.assertEquals(1L, c.getNumberOfChunks()); ctx.assertEquals((long)chunk.length(), c.getSize()); ctx.assertEquals(chunk, c.get(path)); ctx.assertEquals(0L, c.getNumberOfChunks()); ctx.assertEquals(0L, c.getSize()); ctx.assertNull(c.get(path)); }