DataObjectFieldPicker implements DataObjectFieldPickerView.Presenter,
                                              IsWidget { public void init(DataModel dataModel, DataObject rootDataObject, List<ObjectPropertyPath> objectPropertyPaths, PlannerDataObjectEditorView.Presenter presenter) { this.dataModel = dataModel; this.rootDataObject = rootDataObject; this.presenter = presenter; view.displayComparatorCheckbox(true); view.clear(); for (DataObjectFieldPickerItem item : fieldPickerItemList) { fieldPickerItemProducer.destroy(item); } fieldPickerItemList.clear(); if (objectPropertyPaths != null) { view.setComparatorCheckboxValue(true); view.displayFieldPicker(true); for (ObjectPropertyPath path : objectPropertyPaths) { DataObjectFieldPickerItem fieldPickerItem = addFieldPickerItem(); for (ObjectProperty field : path.getObjectPropertyPath()) { fieldPickerItem.onFieldAdded(field, false); fieldPickerItem.onOrderSelectValueChange(path.isDescending(), false); } } } } @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 initWhenComparatorObjectNotSpecified() { fieldPicker.init(mock(DataModel.class), mock(DataObject.class), null, editor); verify(view, times(1)).displayComparatorCheckbox(true); verify(view, times(0)).displayFieldPicker(anyBoolean()); verify(view, times(0)).setComparatorCheckboxValue(anyBoolean()); verify(view, times(1)).clear(); }