public Collection<Value> getRange(Key first, Key last) {
        List<Value> values = new ArrayList();

        // Return the values of the entries found in cache
        for (Map.Entry<Key, EntryWrapper<Key, Value>> entry : entries.subMap(first, true, last, true).entrySet()) {
            Value value = getValue(entry.getKey(), entry.getValue());
            if (value != null) {
                values.add(value);
            }
        }

        return values;
    }
@Test
    public void getRange() {
        RangeCache<Integer, RefString> cache = new RangeCache<>();

        cache.put(0, new RefString("0"));
        cache.put(1, new RefString("1"));
        cache.put(3, new RefString("3"));
        cache.put(5, new RefString("5"));

        assertEquals(cache.getRange(1, 8),
                Lists.newArrayList(new RefString("1"), new RefString("3"), new RefString("5")));

        cache.put(8, new RefString("8"));
        assertEquals(cache.getRange(1, 8),
                Lists.newArrayList(new RefString("1"), new RefString("3"), new RefString("5"), new RefString("8")));

        cache.clear();
        assertEquals(cache.getSize(), 0);
        assertEquals(cache.getNumberOfEntries(), 0);
    }