### Question:
SiteMapResourceChangeListener implements ResourceChangeListener { @Override public void onChange(final List<ResourceChange> changes) { final Set<String> paths = new HashSet<>(); for (final ResourceChange change: changes) { paths.add(change.getPath()); } final Map<String, Object> props = new HashMap<>(); props.put(SiteMapResourceChangeJobConsumer.PN_PATHS, paths); jobManager.addJob(SiteMapResourceChangeJobConsumer.TOPIC, props); }  @Override void onChange(final List<ResourceChange> changes);  }### Answer:
@SuppressWarnings("unchecked") @Test public void onChange() { when(jobManager.addJob(any(), any())).thenAnswer(invocation -> { props.putAll((Map<String, Object>) invocation.getArguments()[1]); return null; }); model.onChange(changes); assertTrue(props.containsKey(SiteMapResourceChangeJobConsumer.PN_PATHS)); final Object pathsObj = props.get(SiteMapResourceChangeJobConsumer.PN_PATHS); assertTrue(pathsObj instanceof Set); final Set<String> paths = (Set<String>) pathsObj; assertTrue(paths.contains(resource.getPath())); assertTrue(paths.contains(jcrContent.getPath())); assertTrue(paths.contains(page.getPath())); }