ValidationRule extends AbstractRuleHolder { public boolean hasChildren() { return (getRules() != null && !getRules().isEmpty()) || (getTemplateReferences() != null && !getTemplateReferences().isEmpty()) || (getValidationContexts() != null && !getValidationContexts().isEmpty()); } ValidationRule();  ValidationRule(String path, String type, String value); boolean hasChildren(); @Override String toString(); String getPath(); void setPath(String path); String getType(); void setType(String type); RuleExecutor<?, ?> getRuleExecutor(); void setRuleExecutor(RuleExecutor<?, ?> ruleExecutor); void setHandler(RuleExecutor<?, ?> handlerImpl); void setHandler(String handlerName); String getValue(); void setValue(String value); void setArgument(String value); synchronized String getMessage(); synchronized void setMessage(String message); synchronized void setMessageCode(String message); String getMessageText(); void setMessageText(String messageText); String getErrorPath(); void setErrorPath(String errorPath); CollectionStrategy getCollectionStrategy(); void setCollectionStrategy(CollectionStrategy collectionStrategy); RuleErrorMode getOnFail(); void setOnFail(RuleErrorMode onFail);  }
@Test public void testHasChildren() { ValidationRule rule = new ValidationRule("test", "type", "value"); assertFalse(rule.hasChildren()); rule.getRules().add(new ValidationRule("subRule", "subRuleType", "subRuleValue")); assertTrue(rule.hasChildren()); rule.getRules().clear(); assertFalse(rule.hasChildren()); rule.getTemplateReferences().add(new ValidationTemplateReference("path", "name")); assertTrue(rule.hasChildren()); }