TreeModelBuilder (@NotNull MultiMap<@NlsSafe String, VirtualFile> switchedFiles) { if (switchedFiles.isEmpty()) return this; ChangesBrowserNode<?> subtreeRoot = createTagNode(ChangesBrowserNode.SWITCHED_FILES_TAG); for (@Nls String branchName : switchedFiles.keySet()) { List<VirtualFile> switchedFileList = sorted(switchedFiles.get(branchName), FILE_COMPARATOR); if (switchedFileList.size() > 0) { ChangesBrowserNode<?> branchNode = new ChangesBrowserStringNode(branchName); branchNode.markAsHelperNode(); insertSubtreeRoot(branchNode, subtreeRoot); for (VirtualFile file : switchedFileList) { insertChangeNode(file, branchNode, ChangesBrowserNode.createFile(myProject, file)); } } } return this; }