public static <T> Updatable addRemoveListener(@NotNull JButton button,
                                                @NotNull JList<T> list,
                                                @Nullable RemoveNotification<T> notification) {
    button.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        List<T> items = removeSelectedItems(list);
        if (notification != null) {
          notification.itemsRemoved(items);
        }
        list.requestFocusInWindow();
      }
    });
    class MyListSelectionListener extends Updatable implements ListSelectionListener {
      MyListSelectionListener(JButton button) {
        super(button);
      }

      @Override
      public void valueChanged(ListSelectionEvent e) {
        setButtonEnabled(canRemoveSelectedItems(list));
      }

      @Override
      protected void update() {
        valueChanged(null);
      }
    }
    MyListSelectionListener listener = new MyListSelectionListener(button);
    list.getSelectionModel().addListSelectionListener(listener);
    listener.update();
    return listener;
  }
public static <T> Updatable addRemoveListener(@NotNull JButton button,
                                                @NotNull JList<T> list,
                                                @Nullable RemoveNotification<T> notification)