UserValidator extends DefaultValidator implements UserConstants { @Override public Validator childNodeChanged(String name, NodeState before, NodeState after) { return newValidator(parentBefore.getChild(name), parentAfter.getChild(name), provider); } UserValidator(Tree parentBefore, Tree parentAfter, UserValidatorProvider provider); @Override void propertyAdded(PropertyState after); @Override void propertyChanged(PropertyState before, PropertyState after); @Override void propertyDeleted(PropertyState before); @Override Validator childNodeAdded(String name, NodeState after); @Override Validator childNodeChanged(String name, NodeState before, NodeState after); @Override Validator childNodeDeleted(String name, NodeState before);  }
@Test public void hiddenNodeChanged() throws CommitFailedException { UserValidatorProvider provider = createValidatorProvider(); MemoryNodeStore store = new MemoryNodeStore(); NodeBuilder builder = store.getRoot().builder(); builder.child("test").child(":hidden"); NodeState root = builder.getNodeState(); NodeBuilder test = root.builder().child("test"); NodeBuilder hidden = test.child(":hidden"); hidden.child("added"); Validator validator = provider.getRootValidator( root, builder.getNodeState(), CommitInfo.EMPTY); Validator childValidator = validator.childNodeChanged( "test", root.getChildNode("test"), test.getNodeState()); assertNotNull(childValidator); Validator hiddenValidator = childValidator.childNodeChanged( ":hidden", root.getChildNode("test").getChildNode(":hidden"), hidden.getNodeState()); assertNull(hiddenValidator); }