### Question:
SiteMapStructureCacheImpl extends CacheBuilderBase implements SiteMapStructureCache, Callback<String>, SiteMapEntry.Visitor<Resource> { private void putSiteMapsInCache(final List<SiteMapEntry> source, final Resource target) throws PersistenceException { final int siteMapsSize = source.size(); final Iterator<SiteMapEntry> iterator = source.iterator(); final ResourceResolver resourceResolver = target.getResourceResolver(); for (int i = 0; i < siteMapsSize; i++) { final String childName = Integer.toString(i); final Resource child = target.getChild(childName); if (nonNull(child)) { resourceResolver.delete(child); } final SiteMapEntry entry = iterator.next(); Optional.ofNullable(entry.walk(this, target, childName)) .map(r -> r.getChild(childName)) .map(r -> r.adaptTo(ModifiableValueMap.class)) .ifPresent(map -> map.put(PATH, entry.getPath())); } removeCachedItemsStartingAtIndex(target, siteMapsSize); }  @Activate void activate(final SiteMapStructureCacheImplConfig config); @Deactivate void deactivate(); @Override List<SiteMapEntry> get(final Resource rootPage); @Override void call(final String rootPagePath); @Override Resource visit(final String childName, final Map<String, String> properties, final Resource resource); @Override Resource visit(final String propertyName, final String propertyValue, final Resource resource); @Override Resource endVisit(final String mapName, final Resource resource); @Override void addRefreshListener(final RefreshListener listener); @Override void removeRefreshListener(final RefreshListener listener); static final String NN_FIRST_CACHE_NODE; }### Answer:
@Test public void putSiteMapsInCache() { repo.mockResourceResolverCreate(); when(extractor.extract(page)).thenReturn(entries); addEntryCache(); SiteMapEntry entry = createEntry(); entry.putProperty("x:y", 0); entries.add(entry); entry = createEntry(); entry.putProperty("x:", 0); entries.add(entry); entry = createEntry(); entry.putProperty("x", 0); entries.add(entry); assertNotNull(model.get(page)); }