ContextImpl implements Context, Constants { @Override public boolean definesTree(@NotNull Tree tree) { return tree.exists() && (isNodeName(tree.getName()) || isNtName(tree)); } private  ContextImpl(); @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 testDefinesTree() { assertTrue(CTX.definesTree(mockTree(REP_PRINCIPAL_POLICY, NT_REP_PRINCIPAL_POLICY, true))); assertTrue(CTX.definesTree(mockTree(REP_RESTRICTIONS, NT_REP_RESTRICTIONS, true))); assertTrue(CTX.definesTree(mockTree("anyEntry", NT_REP_PRINCIPAL_ENTRY, true))); }
@Test public void testNotDefinesTree() { assertFalse(CTX.definesTree(mockTree(REP_PRINCIPAL_POLICY, NT_REP_PRINCIPAL_POLICY, false))); assertFalse(CTX.definesTree(mockTree(REP_RESTRICTIONS, NT_REP_RESTRICTIONS, false))); assertFalse(CTX.definesTree(mockTree("anyEntry", NT_REP_PRINCIPAL_ENTRY, false))); assertFalse(CTX.definesTree(mockTree("anyName", "anyNt", false))); assertFalse(CTX.definesTree(mockTree("anyName", "anyNt", true))); }