void () { final VirtualFile root = getOrCreateProjectBaseDir(); PsiTestUtil.addContentRoot(myModule, root); VirtualFile a = createChildDirectory(root, "a"); VirtualFile mod1 = createChildDirectory(a, "mod1"); VirtualFile mod2 = createChildDirectory(a, "mod2"); VirtualFile b1 = createChildDirectory(mod1, "b"); VirtualFile b2 = createChildDirectory(mod2, "b"); VirtualFile c1 = createChildDirectory(b1, "c"); VirtualFile c2 = createChildDirectory(b2, "c"); createChildData(c1, "f1.txt"); createChildData(c2, "f1.txt"); createChildData(c2, "f10.txt"); createChildData(c2, "f19.txt"); createChildData(c2, "f18.txt"); createChildData(c1, BINARY_FILENAME); createChildData(c2, BINARY_FILENAME); TextFilePatch patch1 = create("mod1/b/c/f1.txt"); TextFilePatch patch2 = create("mod2/b/c/f1.txt"); TextFilePatch patch3 = create("mod26/b4/c3/f188.txt"); ShelvedBinaryFilePatch shelvedBinaryPatch1 = createShelvedBinarySimplePatch("mod1/b/c/" + BINARY_FILENAME); ShelvedBinaryFilePatch shelvedBinaryPatch2 = createShelvedBinarySimplePatch("mod2/b/c/" + BINARY_FILENAME); final MatchPatchPaths iterator = new MatchPatchPaths(myProject); final List<AbstractFilePatchInProgress<?>> result = iterator.execute(Arrays.asList(patch1, patch2, patch3, shelvedBinaryPatch1, shelvedBinaryPatch2)); checkPath(result, "mod1/b/c/f1.txt", Collections.singletonList(a), 0); checkPath(result, "mod2/b/c/f1.txt", Collections.singletonList(a), 0); checkPath(result, "mod26/b4/c3/f188.txt", Collections.singletonList(root), 0); checkPath(result, "mod1/b/c/" + BINARY_FILENAME, Collections.singletonList(a), 0); checkPath(result, "mod2/b/c/" + BINARY_FILENAME, Collections.singletonList(a), 0); }