List<IntentionActionWithTextCaching> (@NotNull CachedIntentions context, @NotNull List<? extends IntentionActionWithTextCaching> intentions) { return ContainerUtil.sorted(intentions, (o1, o2) -> { int weight1 = getWeight(context, o1); int weight2 = getWeight(context, o2); if (weight1 != weight2) { return weight2 - weight1; } return o1.compareTo(o2); }); }