### Question:
EvaluateDecisionTable implements BiFunction<String, BusinessData, CandidateGroup> { @Override public CandidateGroup apply(final String decisionTable, final BusinessData businessData) { DmnDecisionTableResult result = decisionService.evaluateDecisionTableByKey(decisionTable, businessData.toVariables()); DmnDecisionRuleResult singleResult = result.getSingleResult(); return singleResult != null ? new CandidateGroup(singleResult.getSingleEntry()) : CandidateGroup.empty(); } EvaluateDecisionTable(DecisionService decisionService); @Override CandidateGroup apply(final String decisionTable, final BusinessData businessData);  }### Answer:
@Test public void evaluate_3() throws Exception { final HashMap<String,Integer> data = new HashMap<>(); data.put("in", 3); businessData = new BusinessData(data); final CandidateGroup result = evaluate.apply("box", businessData); assertThat(result).isNotNull(); assertThat(result.isNotEmpty()).isTrue(); assertThat(result.getName()).isEqualTo("foo"); }
@Test public void evaluate_0() throws Exception { final HashMap<String,Integer> data = new HashMap<>(); data.put("in", 0); businessData = new BusinessData(data); final CandidateGroup result = evaluate.apply("box", businessData); assertThat(result).isNotNull(); assertThat(result.isNotEmpty()).isTrue(); assertThat(result.getName()).isEqualTo("bar"); }
@Test @Ignore public void evaluate_table_wrong() throws Exception { thrown.expect(ProcessEngineException.class); thrown.expectMessage("no decision definition deployed with key 'Box1'"); final HashMap<String,Integer> data = new HashMap<>(); data.put("in", 3); businessData = new BusinessData(data); evaluate.apply("box1", businessData); }
@Test public void evaluate_input_wrong() throws Exception { thrown.expect(ProcessEngineException.class); thrown.expectCause(CoreMatchers.is(DmnEvaluationException.class)); final HashMap<String,Integer> data = new HashMap<>(); data.put("abc", 3); businessData = new BusinessData(data); evaluate.apply("box", businessData); }