### Question:
ConflictDetectionResultConverter { DiagnosisSet convertDiagnosisSet(int[] diagnosisSet) { final List<DiagnosisElement> elements = Arrays.stream(diagnosisSet) .mapToObj(this::convertDiagnosisElement) .collect(Collectors.toList()); return new DiagnosisSet(elements); } ConflictDetectionResultConverter(TestModel testModel, TestModelExpander expander); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void testConvertDiagnosisSet() { final TestModel expandedTestModel = mock(TestModel.class); when(expandedTestModel.getForbiddenTupleLists()).thenReturn(Collections.emptyList()); when(expandedTestModel.getErrorTupleLists()).thenReturn(Arrays.asList( new TupleList(10, new int[] {0}, Collections.singletonList(new int[] {2})), new TupleList(41, new int[] {0, 1}, Collections.singletonList(new int[] {0, 2})), new TupleList(51, new int[] {0, 1}, Collections.singletonList(new int[] {1, 2})))); final TestModelExpander expander = mock(TestModelExpander.class); when(expander.computeOriginalId(10)).thenReturn(1); when(expander.computeOriginalId(41)).thenReturn(4); when(expander.computeOriginalId(51)).thenReturn(5); final ConflictDetectionResultConverter converter = new ConflictDetectionResultConverter(expandedTestModel, expander); final InternalConflictSet internalConflict = mock(InternalConflictSet.class); when(internalConflict.getConflictSet()).thenReturn(new int[] {10, 41, 51}); final InternalDiagnosisSets internalDiagnosis = mock(InternalDiagnosisSets.class); when(internalDiagnosis.getRootConflictSet()).thenReturn(internalConflict); when(internalDiagnosis.getDiagnosisSets()).thenReturn(new int[][]{ {10}, {41}, {51} }); final DiagnosisSets diagnosisSets = converter.convertDiagnosisSets(internalDiagnosis); assertEquals(3, diagnosisSets.getDiagnosisSets().size()); assertTrue(diagnosisSets.getDiagnosisSets().stream().anyMatch(diagnosisSet -> diagnosisSet.getDiagnosisElements().stream() .anyMatch(element -> element.getDiagnosedConstraintId() == 1 && Arrays.equals(new int[]{0}, element.getInvolvedParameters()) && Arrays.equals(new int[]{2}, element.getConflictingValues())))); assertTrue(diagnosisSets.getDiagnosisSets().stream().anyMatch(diagnosisSet -> diagnosisSet.getDiagnosisElements().stream() .anyMatch(element -> element.getDiagnosedConstraintId() == 4 && Arrays.equals(new int[]{0, 1}, element.getInvolvedParameters()) && Arrays.equals(new int[]{0, 2}, element.getConflictingValues())))); assertTrue(diagnosisSets.getDiagnosisSets().stream().anyMatch(diagnosisSet -> diagnosisSet.getDiagnosisElements().stream() .anyMatch(element -> element.getDiagnosedConstraintId() == 5 && Arrays.equals(new int[]{0, 1}, element.getInvolvedParameters()) && Arrays.equals(new int[]{1, 2}, element.getConflictingValues())))); }