HideInternalContentPathsPredicate implements Predicate { @Override public boolean evaluate(Object object) { String path = ((Resource)object).getPath(); if (FIRST_LEVEL_PATH.matcher(path).matches()) { return StringUtils.equals(path, CONTENT_ROOT_PATH); } return !HIDE_CONTENT_PATHS.contains(path); }  @Override boolean evaluate(Object object);  }
@Test void testEvaluate() { assertTrue(underTest.evaluate(context.resourceResolver().getResource("/"))); assertTrue(underTest.evaluate(context.create().resource("/content"))); assertFalse(underTest.evaluate(context.create().resource("/system"))); assertTrue(underTest.evaluate(context.create().resource("/system/any/other/path"))); assertFalse(underTest.evaluate(context.create().resource("/content/dam"))); assertFalse(underTest.evaluate(context.create().resource("/content/dam/catalogs"))); assertTrue(underTest.evaluate(context.create().resource("/content/dam/any/other/path"))); assertFalse(underTest.evaluate(context.create().resource("/content/launches"))); assertTrue(underTest.evaluate(context.create().resource("/content/any/other/path"))); }