### Question:
ConnectionDisposeListener implements CacheEventListener { @Override public void notifyElementEvicted(final Ehcache cache, final Element element) { }  @Override void dispose(); @Override void notifyElementEvicted(final Ehcache cache, final Element element); @Override void notifyElementExpired(final Ehcache cache, final Element element); @Override void notifyElementPut(final Ehcache cache, final Element element); @Override void notifyElementRemoved(final Ehcache cache, final Element element); @Override void notifyElementUpdated(final Ehcache cache, final Element element); @Override void notifyRemoveAll(final Ehcache cache); @Override ConnectionDisposeListener clone();  }### Answer:
@Test public void testNotifyElementEvicted() { final long existingLimit = cache.getCacheConfiguration().getMaxEntriesLocalHeap(); try { final Element element = cache.get(ELEMENT_NAME); element.setTimeToLive(1); try { Thread.sleep(2000); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); } cache.evictExpiredElements(); verify(connection).closePhysical(); } finally { cache.getCacheConfiguration().setMaxEntriesLocalHeap(existingLimit); } }