### Question:
PulsarClientLRUCache extends LRUMap<K, V> { @Override public void clear() { this.values().parallelStream().forEach(closable -> { releaseResources(closable); }); super.clear(); } PulsarClientLRUCache(int maxSize);  PulsarClientLRUCache(int maxSize, float loadFactor, boolean scanUntilRemovable); @Override void clear();  }### Answer:
@Test public void clearTest() throws PulsarClientException { PulsarClientLRUCache<String, Producer> cache = new PulsarClientLRUCache<String, Producer>(26); for (Character i='A'; i<='Z'; i++) { cache.put(i.toString(), mockedPulsarProducer); } assertEquals(26, cache.size()); cache.clear(); verify(mockedPulsarProducer, times(26)).close(); assertEquals(0, cache.size()); }