void () { String linkedPath1 = myContentDir.getPath() + "/linked1"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath1, true); VirtualFile linkedVFile1 = VfsUtil.findFileByIoFile(new File(linkedPath1, myNonContentFile.getName()), true); assertNotNull(linkedVFile1); String linkedPath2 = myContentDir.getPath() + "/linked2"; IoTestUtil.createSymLink(myNonContentDir.getPath(), linkedPath2, true); VirtualFile linkedVFile2 = VfsUtil.findFileByIoFile(new File(linkedPath2, myNonContentFile.getName()), true); assertNotNull(linkedVFile2); VirtualFile found = ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile); assertTrue(found.equals(linkedVFile1) || found.equals(linkedVFile2)); for(int i = 0; i < 10; i++) { assertEquals("try: " + i, found, ProjectRootUtil.findSymlinkedFileInContent(getProject(), myNonContentVFile)); } }