FinderCacheImpl implements CacheRegistryItem, FinderCache, PortalCacheManagerListener { @Override public void notifyPortalCacheRemoved(String portalCacheName) { if (portalCacheName.startsWith(_GROUP_KEY_PREFIX)) { _portalCaches.remove( portalCacheName.substring(_GROUP_KEY_PREFIX.length())); } }  @Override void clearCache(); @Override void clearCache(String className); void clearCacheByEntityCache(Class<?> clazz); @Override void clearLocalCache(); @Override void dispose(); @Override String getRegistryName(); @Override Object getResult(
		FinderPath finderPath, Object[] args,
		BasePersistenceImpl<? extends BaseModel<?>> basePersistenceImpl); @Override void init(); @Override void invalidate(); @Override void notifyPortalCacheAdded(String portalCacheName); @Override void notifyPortalCacheRemoved(String portalCacheName); @Override void putResult(FinderPath finderPath, Object[] args, Object result); @Override void putResult(
		FinderPath finderPath, Object[] args, Object result, boolean quiet); void removeByEntityCache(Class<?> clazz, BaseModel<?> baseModel); @Override void removeCache(String className); void removeCacheByEntityCache(String cacheName); @Override void removeResult(FinderPath finderPath, Object[] args); void updateByEntityCache(Class<?> clazz, BaseModel<?> baseModel);  }
@Test public void testNotifyPortalCacheRemovedPortalCacheName() { FinderCacheImpl finderCacheImpl = _activateFinderCache( (MultiVMPool)ProxyUtil.newProxyInstance( _classLoader, new Class<?>[] {MultiVMPool.class}, new MultiVMPoolInvocationHandler(_classLoader, true))); PortalCache<Serializable, Serializable> portalCache = ReflectionTestUtil.invoke( finderCacheImpl, "_getPortalCache", new Class<?>[] {String.class}, FinderCacheImplTest.class.getName()); Map<String, PortalCache<Serializable, Serializable>> portalCaches = ReflectionTestUtil.getFieldValue(finderCacheImpl, "_portalCaches"); Assert.assertEquals(portalCaches.toString(), 1, portalCaches.size()); Assert.assertSame( portalCache, portalCaches.get(FinderCacheImplTest.class.getName())); finderCacheImpl.notifyPortalCacheRemoved( portalCache.getPortalCacheName()); Assert.assertTrue(portalCaches.toString(), portalCaches.isEmpty()); }