### Question:
ExpressionEditorControlImpl extends AbstractCanvasControl<AbstractCanvas> implements ExpressionEditorControl { @Override public void bind(final DMNSession session) { final ExpressionEditorView.Presenter editor = makeExpressionEditor(view, decisionNavigator, dmnGraphUtils, dmnDiagramsSession); editor.bind(session); this.session = Optional.of(session); this.expressionEditor = Optional.of(editor); this.refreshEditorDomainObjectListener = new RefreshEditorDomainObjectListener(session); session.getCanvasHandler().addDomainObjectListener(refreshEditorDomainObjectListener); } @Inject  ExpressionEditorControlImpl(final ExpressionEditorView view,
                                       final DecisionNavigatorPresenter decisionNavigator,
                                       final DMNGraphUtils dmnGraphUtils,
                                       final DMNDiagramsSession dmnDiagramsSession,
                                       final Event<CanvasElementUpdatedEvent> canvasElementUpdatedEvent,
                                       final DRDNameChanger drdNameChanger); @Override void bind(final DMNSession session); @Override ExpressionEditorView.Presenter getExpressionEditor(); @SuppressWarnings("unused") void onCanvasFocusedSelectionEvent(final @Observes CanvasSelectionEvent event); void onCanvasElementUpdated(final @Observes CanvasElementUpdatedEvent event);  }### Answer:
@Test public void testBind() { control.bind(session); assertNotNull(control.getExpressionEditor()); verify(editor).bind(session); verify(canvasHandler).addDomainObjectListener(any(CanvasDomainObjectListener.class)); }
@Test public void testBindDomainObjectListenerWithNodeMatch() { final Definition definition = mock(Definition.class); when(graph.nodes()).thenReturn(Collections.singletonList(node)); when(node.getContent()).thenReturn(definition); when(definition.getDefinition()).thenReturn(domainObject); when(domainObject.getDomainObjectUUID()).thenReturn("uuid"); control.bind(session); verify(canvasHandler).addDomainObjectListener(domainObjectListenerCaptor.capture()); final CanvasDomainObjectListener domainObjectListener = domainObjectListenerCaptor.getValue(); domainObjectListener.update(domainObject); verify(canvasElementUpdatedEvent).fire(canvasElementUpdatedEventCaptor.capture()); final CanvasElementUpdatedEvent canvasElementUpdatedEvent = canvasElementUpdatedEventCaptor.getValue(); assertThat(canvasElementUpdatedEvent.getCanvasHandler()).isEqualTo(canvasHandler); assertThat(canvasElementUpdatedEvent.getElement()).isEqualTo(node); }
@Test public void testBindDomainObjectListenerWithNoNodeMatch() { when(graph.nodes()).thenReturn(Collections.emptyList()); control.bind(session); verify(canvasHandler).addDomainObjectListener(domainObjectListenerCaptor.capture()); final CanvasDomainObjectListener domainObjectListener = domainObjectListenerCaptor.getValue(); domainObjectListener.update(domainObject); verify(canvasElementUpdatedEvent, never()).fire(any(CanvasElementUpdatedEvent.class)); }