KiePMMLTreeModelNodeASTFactory { protected boolean isFinalLeaf(final Node node) { return node instanceof LeafNode || node.getNodes() == null || node.getNodes().isEmpty(); } private  KiePMMLTreeModelNodeASTFactory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLOutputField> outputFields, final TreeModel.NoTrueChildStrategy noTrueChildStrategy, final DATA_TYPE targetType); static KiePMMLTreeModelNodeASTFactory factory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap, final List<KiePMMLOutputField> outputFields, final TreeModel.NoTrueChildStrategy noTrueChildStrategy, final DATA_TYPE targetType); List<KiePMMLDroolsRule> declareRulesFromRootNode(final Node node, final String parentPath);  }
@Test public void isFinalLeaf() { Node node = new LeafNode(); DATA_TYPE targetType = DATA_TYPE.STRING; KiePMMLTreeModelNodeASTFactory.factory(new HashMap<>(), Collections.emptyList(), TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION, targetType).isFinalLeaf(node); assertTrue(KiePMMLTreeModelNodeASTFactory.factory(new HashMap<>(), Collections.emptyList(), TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION, targetType).isFinalLeaf(node)); node = new ClassifierNode(); assertTrue(KiePMMLTreeModelNodeASTFactory.factory(new HashMap<>(), Collections.emptyList(), TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION, targetType).isFinalLeaf(node)); node.addNodes(new LeafNode()); assertFalse(KiePMMLTreeModelNodeASTFactory.factory(new HashMap<>(), Collections.emptyList(), TreeModel.NoTrueChildStrategy.RETURN_NULL_PREDICTION, targetType).isFinalLeaf(node)); }