DataObjectFieldPicker implements DataObjectFieldPickerView.Presenter,
                                              IsWidget { @Override public void onFieldPickerItemRemoved(DataObjectFieldPickerItem fieldPickerItem) { int removeIndex = fieldPickerItemList.indexOf(fieldPickerItem); view.removeFieldPickerItem(removeIndex); fieldPickerItemList.remove(fieldPickerItem); for (int i = removeIndex; i < fieldPickerItemList.size(); i++) { fieldPickerItemList.get(i).setFieldPickerItemIndex(i + 1); } fieldPickerItemProducer.destroy(fieldPickerItem); objectPropertyPathChanged(true); } @Inject  DataObjectFieldPicker(final DataObjectFieldPickerView view,
                                 final ManagedInstance<DataObjectFieldPickerItem> fieldPickerItemProducer); void init(DataModel dataModel,
                     DataObject rootDataObject,
                     List<ObjectPropertyPath> objectPropertyPaths,
                     PlannerDataObjectEditorView.Presenter presenter); void destroy(); @Override void onFieldPickerItemRemoved(DataObjectFieldPickerItem fieldPickerItem); @Override void onComparatorSpecified(boolean specified); @Override void onMoveFieldPickerItemUp(DataObjectFieldPickerItem fieldPickerItem); @Override void onMoveFieldPickerItemDown(DataObjectFieldPickerItem fieldPickerItem); @Override DataObjectFieldPickerItem addFieldPickerItem(); @Override Widget asWidget(); void objectPropertyPathChanged(boolean itemsRemoved); boolean isEmpty();  }
@Test public void onFieldPickerItemRemoved() { initFieldPicker(); DataObjectFieldPickerItem item = new DataObjectFieldPickerItem(mock(DataObjectFieldPickerItemView.class)); when(fieldPickerItemProducer.get()).thenReturn(item); fieldPicker.addFieldPickerItem(); fieldPicker.onFieldPickerItemRemoved(item); verify(view, times(1)).removeFieldPickerItem(anyInt()); verify(editor, times(1)).objectPropertyPathChanged(anyList(), eq(true)); }