void (@NotNull String relativePathInsideJar, @NotNull String expectedPointerRelativeUrl, @Nullable String expectedPointerFileName, @NotNull String expectedPathInsideJar) { String abc = "abc" + new SecureRandom().nextLong()+".jar"; String tempRoot = UriUtil.trimTrailingSlashes(FileUtil.toSystemIndependentName(tempDir.getRoot().getPath())); VirtualFilePointer pointer = VirtualFilePointerManager.getInstance().create("jar://" + tempRoot + "/" + abc + relativePathInsideJar, disposable, null); assertEquals(expectedPointerRelativeUrl, StringUtil.trimStart(pointer.getUrl(), "jar://" + tempRoot + "/" + abc)); String expectedPointerFileNameToCheck = expectedPointerFileName == null ? abc : expectedPointerFileName; assertEquals(expectedPointerFileNameToCheck, pointer.getFileName()); assertEquals(JarFileSystem.getInstance(), ((VirtualFilePointerImpl)pointer).myNode.myFS); assertFalse(pointer.isValid()); File jar = IoTestUtil.createTestJar(new File(tempRoot+"/"+abc), List.of(Pair.create(expectedPathInsideJar, new byte[]{' ', ' '}))); assertNotNull(LocalFileSystem.getInstance().refreshAndFindFileByIoFile(jar)); assertTrue(pointer.isValid()); VirtualFile virtualFile = pointer.getFile(); assertNotNull(virtualFile); assertEquals(expectedPointerFileNameToCheck, virtualFile.getName()); }