### Question:
ExpressionUtil { static public FieldValue evaluateNormDiscrete(NormDiscrete normDiscrete, EvaluationContext context){ FieldValue value = evaluate(normDiscrete.getField(), context); if(value == null){ return FieldValueUtil.create(normDiscrete.getMapMissingTo()); } boolean equals = value.equalsString(normDiscrete.getValue()); return FieldValueUtil.create(equals ? 1d : 0d); } private  ExpressionUtil(); static FieldValue evaluate(FieldName name, EvaluationContext context); static FieldValue evaluate(DerivedField derivedField, EvaluationContext context); static FieldValue evaluate(Expression expression, EvaluationContext context); static FieldValue evaluateConstant(Constant constant, EvaluationContext context); static FieldValue evaluateFieldRef(FieldRef fieldRef, EvaluationContext context); static FieldValue evaluateNormContinuous(NormContinuous normContinuous, EvaluationContext context); static FieldValue evaluateNormDiscrete(NormDiscrete normDiscrete, EvaluationContext context); static FieldValue evaluateDiscretize(Discretize discretize, EvaluationContext context); static FieldValue evaluateMapValues(MapValues mapValues, EvaluationContext context); static FieldValue evaluateApply(Apply apply, EvaluationContext context); @SuppressWarnings ( value = {"rawtypes", "unchecked"} ) static FieldValue evaluateAggregate(Aggregate aggregate, EvaluationContext context);  }### Answer:
@Test public void evaluateNormDiscrete(){ FieldName name = new FieldName("x"); Double equals = 1d; Double notEquals = 0d; NormDiscrete stringThree = new NormDiscrete(name, "3"); assertEquals(equals, evaluate(stringThree, createContext(name, "3"))); assertEquals(notEquals, evaluate(stringThree, createContext(name, "1"))); stringThree.setMapMissingTo(5d); assertEquals(5d, evaluate(stringThree, createContext(name, null))); NormDiscrete integerThree = new NormDiscrete(name, "3"); assertEquals(equals, evaluate(integerThree, createContext(name, 3))); assertEquals(notEquals, evaluate(integerThree, createContext(name, 1))); NormDiscrete floatThree = new NormDiscrete(name, "3.0"); assertEquals(equals, evaluate(floatThree, createContext(name, 3f))); assertEquals(notEquals, evaluate(floatThree, createContext(name, 1f))); }