### Question:
ScriptTypeFieldEditorPresenter extends FieldEditorPresenter<ScriptTypeValue> { public void setMode(ScriptTypeMode mode) { getLanguages(mode).forEach(view::addLanguage); } @Inject  ScriptTypeFieldEditorPresenter(final MonacoEditorPresenter monacoEditor);   ScriptTypeFieldEditorPresenter(final View view); @PostConstruct void init(); IsElement getView(); @Override void setValue(ScriptTypeValue value); void setMode(ScriptTypeMode mode); @Override void setReadOnly(boolean readOnly);  }### Answer:
@Test public void testSetCompletionConditionMode() { editor.setMode(ScriptTypeMode.COMPLETION_CONDITION); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.MVEL)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.DROOLS)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.JAVA)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.JAVA_SCRIPT)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.FEEL)); }
@Test public void testSetFlowConditionMode() { editor.setMode(ScriptTypeMode.FLOW_CONDITION); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.JAVA)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.JAVA_SCRIPT)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.MVEL)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.DROOLS)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.FEEL)); }
@Test public void testSetActionScriptMode() { editor.setMode(ScriptTypeMode.ACTION_SCRIPT); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.JAVA)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.JAVA_SCRIPT)); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.MVEL)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.DROOLS)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.FEEL)); }
@Test public void testSetDroolsConditionScriptMode() { editor.setMode(ScriptTypeMode.DROOLS_CONDITION); verify(view, times(1)).addLanguage(eq(MonacoEditorLanguage.DROOLS)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.JAVA)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.JAVA_SCRIPT)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.MVEL)); verify(view, never()).addLanguage(eq(MonacoEditorLanguage.FEEL)); }