void () { AnAction copy = newAction("copy"), paste = newAction("paste"), cut = newAction("cut"); copy.getTemplatePresentation().setText("copy"); paste.getTemplatePresentation().setText("paste"); cut.getTemplatePresentation().setText("cut"); List<AnAction> actions = List.of(copy, paste, cut); DataContext ctx = DataContext.EMPTY_CONTEXT; assertEquals( "suppressAll", List.of(), UtilsKt.rearrangeByPromotersImpl( actions, ctx, List.of(newSuppressor(o -> (List<AnAction>)o)))); assertEquals( "suppressNull", List.of(copy, paste, cut), UtilsKt.rearrangeByPromotersImpl( actions, ctx, List.of(newSuppressor(o -> null)))); assertEquals( "suppressNullAction", List.of(copy, paste, cut), UtilsKt.rearrangeByPromotersImpl( actions, ctx, List.of(newSuppressor(o -> Collections.singletonList(null))))); assertEquals( "suppressLast", List.of(copy, paste), UtilsKt.rearrangeByPromotersImpl( actions, ctx, List.of(newSuppressor(o -> Collections.singletonList(cut))))); }