Source:
<code>public void testGetOtherDMNDiagramsDefinitions() { final Metadata metadata = mock(Metadata.class); final Path path1 = makePath("../file1.dmn"); final Path path2 = makePath("../file2.dmn"); final Path path3 = makePath("../file3.dmn"); <START> final Path path4 = makePath("../file3.dmn"); <END> final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); final Definitions definitions1 = mock(Definitions.class); final Definitions definitions2 = mock(Definitions.class); final Definitions definitions3 = mock(Definitions.class); final List<Path> paths = asList(path1, path2, path3, path4); when(pathsHelper.getDiagramsPaths(any())).thenReturn(paths); when(metadata.getPath()).thenReturn(path2); doReturn(Optional.of(inputStreamReader1)).when(helper).loadPath(path1); doReturn(Optional.of(inputStreamReader2)).when(helper).loadPath(path2); doReturn(Optional.of(inputStreamReader3)).when(helper).loadPath(path3); doReturn(Optional.empty()).when(helper).loadPath(path4); when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); final List<Definitions> actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); final List<Definitions> expectedDefinitions = asList(definitions1, definitions3); assertEquals(expectedDefinitions, actualDefinitions); }</code><technical_language>./file4.dmn</technical_language>

Target:
public void testGetOtherDMNDiagramsDefinitions() { final Metadata metadata = mock(Metadata.class); final Path path1 = makePath("../file1.dmn"); final Path path2 = makePath("../file2.dmn"); final Path path3 = makePath("../file3.dmn"); final Path path4 = makePath("../file4.dmn"); final InputStreamReader inputStreamReader1 = mock(InputStreamReader.class); final InputStreamReader inputStreamReader2 = mock(InputStreamReader.class); final InputStreamReader inputStreamReader3 = mock(InputStreamReader.class); final Definitions definitions1 = mock(Definitions.class); final Definitions definitions2 = mock(Definitions.class); final Definitions definitions3 = mock(Definitions.class); final List<Path> paths = asList(path1, path2, path3, path4); when(pathsHelper.getDiagramsPaths(any())).thenReturn(paths); when(metadata.getPath()).thenReturn(path2); doReturn(Optional.of(inputStreamReader1)).when(helper).loadPath(path1); doReturn(Optional.of(inputStreamReader2)).when(helper).loadPath(path2); doReturn(Optional.of(inputStreamReader3)).when(helper).loadPath(path3); doReturn(Optional.empty()).when(helper).loadPath(path4); when(marshaller.unmarshal(inputStreamReader1)).thenReturn(definitions1); when(marshaller.unmarshal(inputStreamReader2)).thenReturn(definitions2); when(marshaller.unmarshal(inputStreamReader3)).thenReturn(definitions3); final List<Definitions> actualDefinitions = helper.getOtherDMNDiagramsDefinitions(metadata); final List<Definitions> expectedDefinitions = asList(definitions1, definitions3); assertEquals(expectedDefinitions, actualDefinitions); }