CugContext implements Context, CugConstants { @Override public boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property) { return CugUtil.definesCug(parent, property); } private  CugContext(); @Override boolean definesProperty(@NotNull Tree parent, @NotNull PropertyState property); @Override boolean definesContextRoot(@NotNull Tree tree); @Override boolean definesTree(@NotNull Tree tree); @Override boolean definesLocation(@NotNull TreeLocation location); @Override boolean definesInternal(@NotNull Tree tree);  }
@Test public void testDefinesProperty() { Tree cugTree = root.getTree(CUG_PATH); PropertyState repPrincipalNames = cugTree.getProperty(CugConstants.REP_PRINCIPAL_NAMES); assertTrue(CugContext.INSTANCE.definesProperty(cugTree, repPrincipalNames)); assertFalse(CugContext.INSTANCE.definesProperty(cugTree, cugTree.getProperty(JcrConstants.JCR_PRIMARYTYPE))); for (String path : NO_CUG_PATH) { assertFalse(path, CugContext.INSTANCE.definesProperty(root.getTree(path), repPrincipalNames)); } }