private static @NotNull List<DiffTool> moveToolToTop(@NotNull DiffTool tool,
                                                       @NotNull List<DiffTool> oldOrder,
                                                       @NotNull DiffContext diffContext,
                                                       @NotNull DiffRequest diffRequest) {
    List<FrameDiffTool> fittedTools = filterFittedTools(oldOrder, diffContext, diffRequest);
    FrameDiffTool toolToReplace = ContainerUtil.getFirstItem(fittedTools);
    if (toolToReplace == tool) return oldOrder;

    List<DiffTool> newOrder = new ArrayList<>(oldOrder);
    newOrder.remove(tool);

    int index = ContainerUtil.indexOf(newOrder, it -> it == toolToReplace);
    if (index == -1) index = newOrder.size();
    newOrder.add(index, tool);

    return newOrder;
  }
private static @NotNull List<DiffTool> moveToolToTop(@NotNull DiffTool tool,
                                                       @NotNull List<DiffTool> oldOrder,
                                                       @NotNull DiffContext diffContext,
                                                       @NotNull DiffRequest diffRequest)