### Question:
DataTypeConstraintModal extends Elemental2Modal<DataTypeConstraintModal.View> { public void save() { doSave(getComponentConstraintValue()); } @Inject  DataTypeConstraintModal(final View view,
                                   final DataTypeShortcuts dataTypeShortcuts,
                                   final DataTypeConstraintEnumeration constraintEnumeration,
                                   final DataTypeConstraintExpression constraintExpression,
                                   final DataTypeConstraintRange constraintRange); @PostConstruct void setup(); void save(); void show(final BiConsumer<String, ConstraintType> onSaveConsumer); @Override void hide(); void enableOkButton(); void disableOkButton();  }### Answer:
@Test public void testSave() { final DataTypeConstraintComponent constrainComponent = mock(DataTypeConstraintComponent.class); final String value = "value"; doNothing().when(modal).doSave(anyString()); doReturn(constrainComponent).when(modal).getCurrentComponent(); when(constrainComponent.getValue()).thenReturn(value); modal.save(); verify(modal).doSave(value); }