### Question:
MonacoEditorWidget extends TextBoxBase { @Override public void setFocus(final boolean focused) { getCodeEditor().ifPresent(c -> { if (focused) { c.focus(); } }); } MonacoEditorWidget(); void setCodeEditor(final MonacoStandaloneCodeEditor codeEditor); void setValue(final String value); @Override String getValue(); @Override void setFocus(final boolean focused); Optional<MonacoStandaloneCodeEditor> getCodeEditor(); @Override void setTabIndex(final int index);  }### Answer:
@Test public void testSetFocusWhenFocusIsEnabled() { widget.setFocus(true); verify(codeEditor).focus(); }
@Test public void testSetFocusWhenFocusIsNotEnabled() { widget.setFocus(false); verify(codeEditor, never()).focus(); }