### Question:
SiteMapFilesCacheImpl extends CacheBuilderBase implements SiteMapFilesCache, SiteMapStructureCache.RefreshListener { @Override public void onCacheRefreshed(final Resource rootPage, final List<SiteMapEntry> entries) { try (final ResourceResolver resourceResolver = getServiceResourceResolver()) { final Resource cache = getOrCreateCacheResource(resourceResolver, rootPage); buildCache(rootPage, entries, cache); resourceResolver.commit(); } catch (final LoginException e) { logger.error(COULD_NOT_GET_SERVICE_RESOURCE_RESOLVER, e); } catch (final PersistenceException e) { logger.error(COULD_NOT_SAVE_CHANGES_TO_REPOSITORY, e); } }  @Activate void activate(final SiteMapFilesCacheImplConfig config); @Deactivate void deactivate(); @Override String get(final Resource rootPage, final int index); @Override void onCacheRefreshed(final Resource rootPage, final List<SiteMapEntry> entries);  }### Answer:
@Test public void onCacheRefreshed() throws PersistenceException { model.onCacheRefreshed(page, entries); verify(resourceResolver, times(2)).commit(); }