Remove table item(row data)

Hello all,

How to remove table item (row data) with button click (button stores out of table )
if I have an item ID?
I’ve tried to remove with removeItem() and getItemId().remove() methods, but doesn’t work.
I’m a new in vaadin and need your help please.
Could someone help me?
Thanks in advance.

Remove the ItemId from the Container:

@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
final Table table = new Table();
table.setSelectable(true);
table.setMultiSelect(false);

    final BeanItemContainer<Data> bic = new BeanItemContainer<Data>(Data.class);
    bic.addBean(new Data(1, "Tester"));
    bic.addBean(new Data(2, "SecondTester"));
    table.setContainerDataSource(bic);
    layout.addComponent(table);
    layout.setMargin(true);
    setContent(layout);
    Button button = new Button("Click Me");
    button.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //This is the selected ItemId
            Data data = (Data) table.getValue();
             //Removing the ItemId from the Container automaticly updates the Table
            bic.removeItem(data);

        }
    });
    layout.addComponent(button);
}

//Sample Data Bean
public class Data {
private Integer id;
private String name;

    public Data(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}

Thank you very much for your help.