### Question:
SimpleConditionEditorPresenter extends FieldEditorPresenter<Condition> { @Override public void setValue(Condition value) { super.setValue(value); clear(); if (value != null) { if (value.getParams().size() >= 1) { String type = variableSearchService.getOptionType(value.getParams().get(0)); if (type != null) { functionSearchService.reload(type, () -> onSetValue(value)); } else { view.setVariableError(translationService.getValue(VARIABLE_NOT_FOUND_ERROR, value.getParams().get(0))); } } else { view.setConditionError(translationService.getValue(CONDITION_MAL_FORMED)); } } } @Inject  SimpleConditionEditorPresenter(final View view,
                                          final ManagedInstance<ConditionParamPresenter> paramInstance,
                                          final VariableSearchService variableSearchService,
                                          final FunctionSearchService functionSearchService,
                                          final FunctionNamingService functionNamingService,
                                          final ClientTranslationService translationService); @PostConstruct void init(); View getView(); void init(ClientSession session); @Override void setValue(Condition value); @Override void setReadOnly(boolean readOnly); void clear(); boolean isValid();  }### Answer:
@Test public void testSetValueNull() { presenter.setValue(null); verifyClear(); assertNull(presenter.getValue()); verify(paramInstance, never()).get(); }
@Test public void testSetValueWhenConditionMalFormed() { Condition condition = new Condition(); when(translationService.getValue(CONDITION_MAL_FORMED)).thenReturn(TRANSLATED_MESSAGE); presenter.setValue(condition); verify(view).setConditionError(TRANSLATED_MESSAGE); verifyClear(); assertEquals(condition, presenter.getValue()); verify(paramInstance, never()).get(); }