final String mapName = "testEvictionLFU_" + randomString();
final int instanceCount = 1;
final int size = 10000;
Config cfg = new Config();
cfg.setProperty(GroupProperties.PROP_PARTITION_COUNT, "1");
MapConfig mc = cfg.getMapConfig(mapName);
mc.setEvictionPolicy(EvictionPolicy.LFU);
mc.setEvictionPercentage(20);
MaxSizeConfig msc = new MaxSizeConfig();
msc.setMaxSizePolicy(MaxSizeConfig.MaxSizePolicy.PER_NODE);
msc.setSize(size);
mc.setMaxSizeConfig(msc);
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(instanceCount);
final HazelcastInstance[] instances = factory.newInstances(cfg);
final int atLeastShouldEvict = size / 40;
final CountDownLatch latch = new CountDownLatch(atLeastShouldEvict);
IMap<Object, Object> map = instances[0].getMap(mapName);