### Question:
ConflictDetectionResultConverter { InconsistentBackground convertInconsistentBackground(InternalInconsistentBackground inconsistentBackground) { final List<ConflictElement> elements = Arrays.stream(inconsistentBackground.getBackground()) .mapToObj(this::convertConflictElement) .collect(Collectors.toList()); return new InconsistentBackground(elements); } ConflictDetectionResultConverter(TestModel testModel, TestModelExpander expander); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void testConvertInconsistentBackground() { final TestModel testModel = mock(TestModel.class); when(testModel.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 InternalInconsistentBackground background = mock(InternalInconsistentBackground.class); when(background.getBackground()).thenReturn(new int[]{10, 41, 51}); 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(testModel, expander); final InconsistentBackground inconsistentBackground = converter.convertInconsistentBackground(background); assertEquals(3, inconsistentBackground.getConflictElements().size()); assertTrue(inconsistentBackground.getConflictElements().stream() .anyMatch(conflict -> conflict.getConflictingConstraintId() == 1 && Arrays.equals(new int[] {0}, conflict.getInvolvedParameters()) && Arrays.equals(new int[] {2}, conflict.getConflictingValues())) ); assertTrue(inconsistentBackground.getConflictElements().stream() .anyMatch(conflict -> conflict.getConflictingConstraintId() == 4 && Arrays.equals(new int[] {0, 1}, conflict.getInvolvedParameters()) && Arrays.equals(new int[] {0, 2}, conflict.getConflictingValues())) ); assertTrue(inconsistentBackground.getConflictElements().stream() .anyMatch(conflict -> conflict.getConflictingConstraintId() == 5 && Arrays.equals(new int[] {0, 1}, conflict.getInvolvedParameters()) && Arrays.equals(new int[] {1, 2}, conflict.getConflictingValues())) ); }