private static void initTreeStateIfNeeded(@NotNull ChangesListView view,
                                              @NotNull ChangesBrowserNode<?> newRoot,
                                              int oldFileCount) {
      ChangesBrowserNode<?> defaultListNode = getDefaultChangelistNode(newRoot);
      if (defaultListNode == null) return;

      if (view.getSelectionCount() == 0) {
        TreeUtil.selectNode(view, defaultListNode);
      }

      if (oldFileCount == 0 && TreeUtil.collectExpandedPaths(view).isEmpty()) {
        view.expandSafe(defaultListNode);
      }
    }
private static void initTreeStateIfNeeded(@NotNull ChangesListView view,
                                              @NotNull ChangesBrowserNode<?> newRoot,
                                              int oldFileCount)