### Question:
ItemDefinitionUpdateHandler { UnaryTests makeAllowedValues(final DataType dataType, final ItemDefinition itemDefinition) { final String constraint = dataType.getConstraint(); if (isEmpty(constraint)) { return null; } if (!Objects.equals(constraint, getText(itemDefinition))) { return new UnaryTests(new Id(), new Description(), new Text(constraint), null, dataType.getConstraintType()); } return itemDefinition.getAllowedValues(); } @Inject  ItemDefinitionUpdateHandler(final DataTypeManager dataTypeManager,
                                       final ItemDefinitionUtils itemDefinitionUtils,
                                       final PropertiesPanelNotifier panelNotifier,
                                       final Event<DataTypeChangedEvent> dataTypeChangedEvent); void update(final DataType dataType,
                       final ItemDefinition itemDefinition);  }### Answer:
@Test public void testMakeAllowedValuesWhenDataTypeConstraintIsBlank() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(dataType.getConstraint()).thenReturn(""); final UnaryTests actualAllowedValues = handler.makeAllowedValues(dataType, itemDefinition); assertNull(actualAllowedValues); }
@Test public void testMakeAllowedValuesWhenDataTypeConstraintIsNull() { final DataType dataType = mock(DataType.class); final ItemDefinition itemDefinition = mock(ItemDefinition.class); when(dataType.getConstraint()).thenReturn(null); when(dataType.getConstraintType()).thenReturn(null); final UnaryTests actualAllowedValues = handler.makeAllowedValues(dataType, itemDefinition); assertNull(actualAllowedValues); }