### Question:
ProjectExplorerContentResolver { List<FolderItem> getSegmentSiblings(final Path path) { final List<FolderItem> result = new ArrayList<>(); final org.uberfire.java.nio.file.Path nioPath = Paths.convert(path); if (nioPath.equals(nioPath.getRoot())) { result.add(explorerServiceHelper.toFolderItem(nioPath)); } else { final org.uberfire.java.nio.file.Path nioParentPath = nioPath.getParent(); for (org.uberfire.java.nio.file.Path sibling : getDirectoryIterator(nioParentPath)) { result.add(explorerServiceHelper.toFolderItem(sibling)); } } return result; } @Inject  ProjectExplorerContentResolver(final KieModuleService moduleService,
                                          final ExplorerServiceHelper helper,
                                          final ExplorerServiceHelper explorerServiceHelper,
                                          final WorkspaceProjectService projectService); ProjectExplorerContent resolve(final ProjectExplorerContentQuery query);  }### Answer:
@Test public void getSegmentSiblingsRootTest() { doAnswer(invocationOnMock -> { final Path p = Paths.convert((org.uberfire.java.nio.file.Path) invocationOnMock.getArguments()[0]); return new FolderItem(p, p.getFileName(), FolderItemType.FOLDER); }).when(explorerServiceHelper).toFolderItem(any(org.uberfire.java.nio.file.Path.class)); Path path = PathFactory.newPath("/", "default: final List<FolderItem> siblings = resolver.getSegmentSiblings(path); assertEquals(1, siblings.size()); assertEquals("/", siblings.get(0).getFileName()); }
@Test public void getSegmentSiblingsTest() { doAnswer(invocationOnMock -> { final Path p = Paths.convert((org.uberfire.java.nio.file.Path) invocationOnMock.getArguments()[0]); return new FolderItem(p, p.getFileName(), FolderItemType.FOLDER); }).when(explorerServiceHelper).toFolderItem(any(org.uberfire.java.nio.file.Path.class)); Path path = PathFactory.newPath("src", "default: final List<org.uberfire.java.nio.file.Path> mockedSiblings = new ArrayList<>(); mockedSiblings.add(Paths.convert(path)); mockedSiblings.add(Paths.convert(PathFactory.newPath("src", "default: doReturn(mockedSiblings).when(resolver).getDirectoryIterator(any(org.uberfire.java.nio.file.Path.class)); final List<FolderItem> siblings = resolver.getSegmentSiblings(path); assertEquals(2, siblings.size()); assertEquals("src", siblings.get(0).getFileName()); assertEquals("pom.xml", siblings.get(1).getFileName()); }