@Test void testAdd() { Entity entity = mock(Entity.class); l1CacheRepositoryDecorator.add(entity); verify(l1CacheJanitor).cleanCacheBeforeAdd(entity); verify(l1Cache).put(entity); verify(delegateRepository).add(entity); verifyNoMoreInteractions(l1CacheJanitor, l1Cache, delegateRepository); }
@Override public void add(Entity entity) { if (useCache()) { l1CacheJanitor.cleanCacheBeforeAdd(entity); putCache(entity); } delegate().add(entity); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void add(Entity entity) { if (useCache()) { l1CacheJanitor.cleanCacheBeforeAdd(entity); putCache(entity); } delegate().add(entity); } }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void add(Entity entity) { if (useCache()) { l1CacheJanitor.cleanCacheBeforeAdd(entity); putCache(entity); } delegate().add(entity); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void add(Entity entity) { if (useCache()) { l1CacheJanitor.cleanCacheBeforeAdd(entity); putCache(entity); } delegate().add(entity); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void add(Entity entity) { if (useCache()) { l1CacheJanitor.cleanCacheBeforeAdd(entity); putCache(entity); } delegate().add(entity); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll();  }