Registration.remove(); instead removeClickListener();

As you know after Framework 8.0 there is deprecated metod ‘removeClickListner()’ and it guides me to use .remove() of Registration.

But how to use on an example? I can’t figure it out.

I have this

 public static Button.ClickListener exampleListener = new ClickListener() {
      	public void buttonClick(ClickEvent event) {
      		exampleButton.addClickListener(e -> ...);
          }
      };
	  
	  exampleButton.remove();

Doesn’t work of course.

In Vaadin 8 the it goes like this

Button button = new Button("Click me");
Registration registration = button.addClickListener(event -> {
   addComponent(new Label("Button clicked"));
});

registration.remove();

THANKS! <3