private ConfigurationBuilder buildCfg(EvictionThreadPolicy threadPolicy, EvictionStrategy strategy) {
ConfigurationBuilder cfg = new ConfigurationBuilder();
cfg
.persistence().passivation(true).addStore(DummyInMemoryStoreConfigurationBuilder.class).purgeOnStartup(true)
.invocationBatching().enable();
cfg.eviction().strategy(strategy);
// If the strategy is NONE then don't use thread policy or strategy or max entries (forces default strategy)
if (strategy != EvictionStrategy.NONE) {
cfg.eviction().threadPolicy(threadPolicy).maxEntries(EVICTION_MAX_ENTRIES);
}
return cfg;