### Question:
SparseDecisionDetector extends SimpleLazyEvaluationDetector { boolean isSparseDecisionTable(TDecisionTable expression, double sparsityThreshold) { int columnNo = expression.getInput().size(); int lineNo = expression.getRule().size(); int anyMatchCount = 0; for(TDecisionRule rule: expression.getRule()) { for(TUnaryTests test : rule.getInputEntry()) { if ("-".equals(test.getText())) { anyMatchCount++; } } } double sparsity = 1.0 * anyMatchCount / (lineNo * columnNo); return sparsity >= sparsityThreshold; } SparseDecisionDetector();  SparseDecisionDetector(Map<String, String> inputParameters, BuildLogger logger); @Override LazyEvaluationOptimisation detect(DMNModelRepository modelRepository);  }### Answer:
@Test public void testIsSparseDecisionTable() { TDefinitions definitions = this.dmnModelRepository.getRootDefinitions(); checkDecisionTable(dmnModelRepository.findDRGElementByName(definitions, "EligibilityRules"), 0.75, true); checkDecisionTable(dmnModelRepository.findDRGElementByName(definitions, "Strategy"), 0.75, false); }