    @Test
    public void testEvictionConfigIsDerivedFromMapConfig() {

        MapConfig mapConfig = mock(MapConfig.class);

        Config config = mock(Config.class);
        when(config.findMapConfig(eq(CACHE_NAME))).thenReturn(mapConfig);

        com.hazelcast.config.EvictionConfig maxSizeConfig = mock(com.hazelcast.config.EvictionConfig.class);
        when(mapConfig.getEvictionConfig()).thenReturn(maxSizeConfig);

        HazelcastInstance instance = mock(HazelcastInstance.class);
        when(instance.getConfig()).thenReturn(config);

        new LocalRegionCache(CACHE_NAME, instance, null, false)
          .cleanup();

        verify(maxSizeConfig).getSize();
        verify(mapConfig).getTimeToLiveSeconds();
    }