void () { final VirtualFile root = getOrCreateProjectBaseDir(); PsiTestUtil.addContentRoot(myModule, root); VirtualFile a = createChildDirectory(root, "a"); VirtualFile b = createChildDirectory(a, "b"); VirtualFile c = createChildDirectory(b, "c"); createChildData(c, "f1.txt"); createChildData(c, "f2.txt"); createChildData(c, "f3.txt"); createChildData(c, "f4.txt"); TextFilePatch patch1 = create("a1/b1/c/f1.txt"); TextFilePatch patch2 = create("h1/cccc/f2.txt"); TextFilePatch patch3 = create("b/c/f3.txt"); TextFilePatch patch4 = create("b/ccc/f4.txt"); TextFilePatch patch5 = create("h1/c/f10.txt"); final MatchPatchPaths iterator = new MatchPatchPaths(myProject); final List<AbstractFilePatchInProgress<?>> result = iterator.execute(Arrays.asList(patch1, patch2, patch3, patch4, patch5)); checkPath(result, "c/f1.txt", Collections.singletonList(b), 2); checkPath(result, "f2.txt", Collections.singletonList(c), 2); checkPath(result, "b/c/f3.txt", Collections.singletonList(a), 0); checkPath(result, "f4.txt", Collections.singletonList(c), 2); checkPath(result, "h1/c/f10.txt", Collections.singletonList(root), 0); }