class SparseDecisionDetector extends SimpleLazyEvaluationDetector {

    @Override
    public LazyEvaluationOptimisation detect(DMNModelRepository modelRepository) {
        LazyEvaluationOptimisation lazyEvaluationOptimisation = new LazyEvaluationOptimisation();
        logger.info("Scanning for sparse decisions ...");

        for (TDefinitions definitions: modelRepository.getAllDefinitions()) {
            for (TDecision decision : modelRepository.findDecisions(definitions)) {
                JAXBElement<? extends TExpression> element = decision.getExpression();
                TExpression expression = element == null ? null : element.getValue();
                if (expression instanceof TDecisionTable && isSparseDecisionTable((TDecisionTable) expression, sparsityThreshold)) {

                    logger.info(String.format("Found sparse decision '%s'", decision.getName()));

                    for (TInformationRequirement ir : decision.getInformationRequirement()) {
                        TDMNElementReference requiredDecision = ir.getRequiredDecision();
                        if (requiredDecision != null) {
                            String href = requiredDecision.getHref();
                            TDecision drgElement = modelRepository.findDecisionByRef(decision, href);
                            if (drgElement != null) {
                                lazyEvaluationOptimisation.addLazyEvaluatedDecision(drgElement.getName());
                            }
                        }
                    }
                }
            }
        }

        logger.info(String.format("Decisions to be lazy evaluated: '%s'", String.join(", ", lazyEvaluationOptimisation.getLazyEvaluatedDecisions())));
        return lazyEvaluationOptimisation;
    }

    public  SparseDecisionDetector();
    public  SparseDecisionDetector(Map<String, String> inputParameters, BuildLogger logger);

}