@Test
public void process() {

    resource.setPrimaryType("per:X");
    initialPaths.add(resource.getPath());
    page.setPrimaryType("per:Page");
    initialPaths.add(page.getPath());
    parent.setPrimaryType("per:Y");
    initialPaths.add(parent.getPath());
    final Set<Object> rebuilt = new HashSet<>();
    doAnswer(invocation -> {
        rebuilt.add(invocation.getArguments()[0]);
        return null;
    }).when(cache).rebuild(anyString());
    assertEquals(JobConsumer.JobResult.OK, model.process(job));
    assertTrue(rebuilt.contains(resource.getPath()));
    assertFalse(rebuilt.contains(page.getPath()));
    assertTrue(rebuilt.contains(parent.getPath()));
}