### Question:
ContentVisitor extends AbstractResourceVisitor { @Override public void accept(Resource resource) { if (resource != null) { final String primaryType = resource.getValueMap().get(JcrConstants.JCR_PRIMARYTYPE, String.class); if (ArrayUtils.contains(containerTypes, primaryType) || ArrayUtils.contains(contentTypes, primaryType)) { super.accept(resource); } } } ContentVisitor(T runnable);  ContentVisitor(T runnable, String[] containerTypes, String[] contentTypes); @Override void accept(Resource resource);  }### Answer:
@Test public void accept_ContentDAMAsset() throws Exception { properties.put(JcrConstants.JCR_PRIMARYTYPE, "dam:Asset"); ContentVisitor visitor = new ContentVisitor(runnable); visitor.accept(resource); verify(runnable, times(1)).run(resource); }
@Test public void accept_ContentCqPage() throws Exception { properties.put(JcrConstants.JCR_PRIMARYTYPE, "cq:Page"); ContentVisitor visitor = new ContentVisitor(runnable); visitor.accept(resource); verify(runnable, times(1)).run(resource); }
@Test public void accept_ContentCqTag() throws Exception { properties.put(JcrConstants.JCR_PRIMARYTYPE, "cq:Tag"); ContentVisitor visitor = new ContentVisitor(runnable); visitor.accept(resource); verify(runnable, times(1)).run(resource); }
@Test public void accept_ContentInvalid() throws Exception { properties.put(JcrConstants.JCR_PRIMARYTYPE, "oak:Unstructured"); ContentVisitor visitor = new ContentVisitor(runnable); visitor.accept(resource); verify(runnable, times(0)).run(resource); }