class ReduceBasedDiagnosisHittingSetBuilder {

    public List<DiagnosisHittingSet> computeMinimalDiagnosisHittingSets(List<MissingInvalidTuple> mits) {
        Preconditions.notNull(mits);
        Preconditions.check(mits.size() > 0);
        Preconditions.check(mits.stream().allMatch(mit -> isDiagnosisSetsOrInconsistentBackground(mit.getExplanation())));

        final List<MissingInvalidTuple> extendedMits = extendWithDiagnosisSetsforNegatedErrorConstraints(mits);

        final List<Set<Set<DiagnosisElement>>> sets = extendedMits.stream()
                .map(mit -> new HashSet<Set<DiagnosisElement>>(
                        ((DiagnosisSets) mit.getExplanation()).getDiagnosisSets().stream()
                                .map(ds -> new HashSet<>(ds.getDiagnosisElements()))
                        .collect(Collectors.toSet())))
                .collect(Collectors.toList());

        final Set<Set<DiagnosisElement>> selections = sets.stream()
                .reduce(Collections.emptySet(), this::reduceToDiagnosisHittingSets);

        return selections.stream()
                .map(selection -> new DiagnosisHittingSet(new ArrayList<>(selection)))
                .collect(Collectors.toList());
    }

    public  ReduceBasedDiagnosisHittingSetBuilder(TestModel testModel);

}