### Question:
LongObjectCache extends LongObjectCacheBase<V> { public Iterator<V> values() { return new LongObjectCacheValuesIterator<>(this); } LongObjectCache();  LongObjectCache(int cacheSize);  LongObjectCache(int cacheSize, float secondGenSizeRatio); @Override void clear(); @Override void lock(); @Override void unlock(); @Override V remove(final long key); void removeAll(); @Override V cacheObject(final long key, @NotNull final V x); @Override V tryKey(final long key); @Override V getObject(final long key); @Override int count(); Iterator<Long> keys(); Iterator<V> values(); boolean forEachEntry(final ObjectProcedure<Map.Entry<Long, V>> procedure); void addDeletedPairsListener(final DeletedPairsListener<V> listener); void removeDeletedPairsListener(final DeletedPairsListener<V> listener); static final float DEFAULT_SECOND_GENERATION_QUEUE_SIZE_RATIO; }### Answer:
@Test public void cacheIterator() { LongObjectCache<String> cache = new LongObjectCache<>(4); cache.put(0, "An IDE"); cache.put(1, "good IDEA"); cache.put(2, "better IDEA"); cache.put(3, "perfect IDEA"); cache.put(4, "IDEAL"); HashSet<String> values = new HashSet<>(); final Iterator<String> it = cache.values(); while (it.hasNext()) { values.add(it.next()); } Assert.assertNull(cache.get(0)); Assert.assertFalse(values.contains("An IDE")); Assert.assertTrue(values.contains("good IDEA")); Assert.assertTrue(values.contains("better IDEA")); Assert.assertTrue(values.contains("perfect IDEA")); Assert.assertTrue(values.contains("IDEAL")); }