Node extends TreeNode { @Override public boolean isCompletelySpecified(List<ValidationError> errors) { boolean noError = true; if (this.children.size() == 0) { errors.add(new ValidationError("Node " + this.getName() + " has no Children.", this)); noError = false; } if (this.hasDuplicates(errors)) { noError = false; } return noError; } Node(); void addChild(TreeNode n); void removeChild(TreeNode n); void convert(); @Override /** * @return false */ boolean isLeaf(); EvaluationStatus getEvaluationStatus(); @Override boolean isCompletelySpecified(List<ValidationError> errors); @Override /** * unused - we go directly down to allLeaves(). * TODO This should actually check and aggregate the evaluation status of the children * @return true (always!) */ boolean isCompletelyEvaluated(List<Alternative> alternatives,
            List<ValidationError> errors); @Override boolean isCompletelyTransformed(List<ValidationError> errors); @Override boolean isCorrectlyWeighted(List<ValidationError> errors); @Override TreeNode clone(); void normalizeWeights(boolean recursive);  }
@Test public void isCompletelySpecified() { Node node = new Node(); Leaf leaf = new Leaf(); leaf.setName("Name"); node.addChild(leaf); node.addChild(leaf); Leaf leaf2 = new Leaf(); leaf2.setName("Name2"); node.addChild(leaf2); node.addChild(leaf2); List<ValidationError> errors = new ArrayList<ValidationError>(); node.isCompletelySpecified(errors); assert (errors.size() == 2); }