test_class.declarator: cache
test_class.modifier: @Mock
test_class.original_string: @Mock
    Cache<Object, Object> cache;
test_class.type: Cache<Object, Object>
test_class.var_name: cache
test_class.declarator: entry
test_class.modifier: @Mock
test_class.original_string: @Mock
    CacheEntry<Object, Object> entry;
test_class.type: CacheEntry<Object, Object>
test_class.var_name: entry
test_class.declarator: populator
test_class.original_string: LazyCachePopulator<Object, Object> populator;
test_class.type: LazyCachePopulator<Object, Object>
test_class.var_name: populator
test_class.file: imcache-core/src/test/java/com/cetsoft/imcache/cache/populator/LazyCachePopulatorTest.java
test_class.identifier: LazyCachePopulatorTest
test_case.body: @Test
    public void populate() {
      Object object = new Object();
      List<CacheEntry<Object, Object>> entries = new ArrayList<CacheEntry<Object, Object>>();
      entries.add(entry);
      doReturn(object).when(entry).getKey();
      doReturn(object).when(entry).getValue();
      doReturn(entries).when(populator).loadEntries();
      doNothing().when(cache).put(object, object);
      populator.pupulate();
      try {
        Thread.sleep(10);
      } catch (InterruptedException e) {
      }
      verify(cache, atLeast(1)).put(object, object);
      verify(populator).loadEntries();
    }
test_case.class_method_signature: LazyCachePopulatorTest.populate()
test_case.full_signature: @Test public void populate()
test_case.identifier: populate
test_case.invocations: add getKey when doReturn getValue when doReturn loadEntries when doReturn put when doNothing pupulate sleep put verify atLeast loadEntries verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void populate()
focal_class.file: imcache-core/src/main/java/com/cetsoft/imcache/cache/populator/LazyCachePopulator.java
focal_class.identifier: LazyCachePopulator
focal_class.class_method_signature: LazyCachePopulator.LazyCachePopulator(Cache<K, V> cache)
focal_class.full_signature: public  LazyCachePopulator(Cache<K, V> cache)
focal_class.identifier: LazyCachePopulator
focal_class.modifiers: public
focal_class.parameters: (Cache<K, V> cache)
focal_class.signature:  LazyCachePopulator(Cache<K, V> cache)
focal_class.class_method_signature: LazyCachePopulator.pupulate()
focal_class.full_signature: public void pupulate()
focal_class.identifier: pupulate
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void pupulate()
focal_class.superclass: extends AbstractCachePopulator<K, V>
focal_method.body: public void pupulate() {
      final ExecutorService lazyExecuor = Executors.newSingleThreadExecutor(runnable -> ThreadUtils
          .createDaemonThread(runnable,
              "imcache:cachePopulator(name=" + cache.getName() + ",thread=0)"));
      lazyExecuor.execute(() -> {
        final List<CacheEntry<K, V>> entries = loadEntries();
        for (CacheEntry<K, V> cacheEntry : entries) {
          cache.put(cacheEntry.getKey(), cacheEntry.getValue());
        }
      });
      lazyExecuor.shutdown();
    }
focal_method.class_method_signature: LazyCachePopulator.pupulate()
focal_method.full_signature: public void pupulate()
focal_method.identifier: pupulate
focal_method.invocations: newSingleThreadExecutor createDaemonThread getName execute loadEntries put getKey getValue shutdown
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void pupulate()