@Test
public void testOnRemoveItemButtonClicked() throws Exception {

    // prepare
    List<ConfigurationItem> selectedConfigurationItemsForFirstName = createSelectedConfigurationItemsForFirstName();
    selectedConfigurationItemsForFirstName.get(2).rememberLastEntryForId("last_name");
    model.showDialog(FillTheFormDialogModel.EVENT_TYPE_VIEW_LONG_CLICKED, selectedConfigurationItemsForFirstName);
    model.onConfigurationItemClicked(2);
    List<ConfigurationItem> selectedConfigurationItemsForLastName = createSelectedConfigurationItemsForLastName();
    model.showDialog(FillTheFormDialogModel.EVENT_TYPE_VIEW_LONG_CLICKED, selectedConfigurationItemsForLastName);
    // verify
    assertEquals(selectedConfigurationItemsForLastName.size() + 1, model.getSortedConfigurationItems().size());
    // run
    model.onRemoveItemButtonClicked(0);
    // verify
    assertEquals(selectedConfigurationItemsForLastName.size(), model.getSortedConfigurationItems().size());
    verify(propertyChangedListener, times(6)).onPropertyChanged(FillTheFormDialogModel.PROPERTY_DATA_SET);
}