KiePMMLDescrLhsFactory { protected void declareConstraintNotIn(final String patternType, final List<Object> values) { String constraints = getInNotInConstraint(values); builder.not().pattern(patternType).constraint(constraints); } private  KiePMMLDescrLhsFactory(final CEDescrBuilder<RuleDescrBuilder, AndDescr> builder); static KiePMMLDescrLhsFactory factory(final CEDescrBuilder<RuleDescrBuilder, AndDescr> builder); void declareLhs(final KiePMMLDroolsRule rule);  }
@Test public void declareConstraintNotIn() { List<Object> values = Arrays.asList("3", "8.5"); String patternType = "INPUT2"; KiePMMLDescrLhsFactory.factory(lhsBuilder).declareConstraintNotIn(patternType, values); final List<BaseDescr> descrs = lhsBuilder.getDescr().getDescrs(); assertNotNull(descrs); assertEquals(1, descrs.size()); assertTrue(descrs.get(0) instanceof NotDescr); NotDescr notDescr = (NotDescr) descrs.get(0); assertEquals(1, notDescr.getDescrs().size()); assertTrue(notDescr.getDescrs().get(0) instanceof PatternDescr); PatternDescr patternDescr = (PatternDescr) notDescr.getDescrs().get(0); assertEquals(patternType, patternDescr.getObjectType()); assertNull(patternDescr.getIdentifier()); assertTrue(patternDescr.getConstraint() instanceof AndDescr); AndDescr andDescr = (AndDescr) patternDescr.getConstraint(); assertEquals(1, andDescr.getDescrs().size()); assertTrue(andDescr.getDescrs().get(0) instanceof ExprConstraintDescr); ExprConstraintDescr exprConstraintDescr = (ExprConstraintDescr) andDescr.getDescrs().get(0); assertFalse(exprConstraintDescr.isNegated()); assertEquals(ExprConstraintDescr.Type.NAMED, exprConstraintDescr.getType()); String expected = "value in (3, 8.5)"; assertEquals(expected, exprConstraintDescr.getExpression()); }