OpenedFilesChangesFactory { @NotNull static List<FilePath> getLocalFiles(@NotNull List<IExtendedFileSpec> files) { List<FilePath> ret = new ArrayList<>(files.size()); for (IExtendedFileSpec file : files) { ret.add(VcsUtil.getFilePath(file.getLocalPath().getPathString(), false)); } return ret; }  static ListOpenedFilesChangesResult createListOpenedFilesChangesResult(
            @NotNull ClientConfig config,
            @NotNull List<IChangelist> changes,
            @NotNull List<IExtendedFileSpec> pendingChangelistFiles,
            @NotNull Map<Integer, List<IFileSpec>> shelvedFiles,
            @NotNull List<IExtendedFileSpec> openedDefaultChangelistFiles);  }
@ExtendWith(TemporaryFolderExtension.class) @Test void simpleAddedFiles_localFiles(TemporaryFolder tmpDir) throws IOException, InterruptedException { P4CommandUtil cmd = new P4CommandUtil(); ClientConfig clientConfig = createClientConfig(); File clientRoot = tmpDir.newFile("clientRoot"); if (!clientRoot.isDirectory() && !clientRoot.mkdirs()) { throw new IOException("could not mkdir " + clientRoot); } setupClient(clientConfig, tmpDir, clientRoot) .map((mgr) -> mgr.withConnection(clientConfig, (client) -> { File f1 = touchFile(clientRoot, "abc.txt"); File f2 = touchFile(clientRoot, "a@b.txt"); try { List<IFileSpec> addedFiles = client.addFiles(FileSpecBuildUtil.forFiles(f1, f2), new AddFilesOptions(false, -1, "text", true)); assertSize(2, addedFiles); assertNoErrors(addedFiles); List<IExtendedFileSpec> openedDefaultChangelistFiles = cmd.getFilesOpenInDefaultChangelist(client.getServer(), clientConfig.getClientname(), 100); List<FilePath> paths = OpenedFilesChangesFactory.getLocalFiles(openedDefaultChangelistFiles); assertSize(2, paths); FilePath path1 = paths.get(0); FilePath path2 = paths.get(1); if (path2.getName().equals("abc.txt")) { FilePath t = path1; path1 = path2; path2 = t; } assertEquals("abc.txt", path1.getName()); assertEquals("a@b.txt", path2.getName()); return Promise.resolve(null); } catch (P4JavaException e) { return Promises.rejectedPromise(e); } })).blockingWait(5, TimeUnit.SECONDS); }