### Question:
DMNElementsSynchronizer { public void onExpressionEditorChanged(final @Observes ExpressionEditorChanged event) { final Optional<Node> node = getNode(event.getNodeUUID()); synchronizeFromNode(node); } @Inject  DMNElementsSynchronizer(final DMNDiagramsSession dmnDiagramsSession,
                                   final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent,
                                   final DMNGraphUtils graphUtils,
                                   final NodeTextSetter nodeTextSetter); void onExpressionEditorChanged(final @Observes ExpressionEditorChanged event); void onPropertyChanged(final @Observes FormFieldChanged event); void synchronizeElementsFrom(final DRGElement drgElement); void synchronizeFromNode(final Optional<Node> node);  }### Answer:
@Test public void testOnExpressionEditorChanged() { final ExpressionEditorChanged event = mock(ExpressionEditorChanged.class); final String id = "id"; final Node node = mock(Node.class); final Optional<Node> nodeOptional = Optional.of(node); when(event.getNodeUUID()).thenReturn(id); doReturn(nodeOptional).when(synchronizer).getNode(id); doNothing().when(synchronizer).synchronizeFromNode(nodeOptional); synchronizer.onExpressionEditorChanged(event); verify(synchronizer).getNode(id); verify(synchronizer).synchronizeFromNode(nodeOptional); }