TreeModelListener (final @NotNull PairConsumer<? super TreeModelEvent, ? super EventType> consumer) { return new TreeModelAdapter() { @Override protected void process(@NotNull TreeModelEvent event, @NotNull EventType type) { consumer.consume(event, type); } }; }