### Question:
DecisionTableEditorDefinitionEnricher implements ExpressionEditorModelEnricher<DecisionTable> { private void addInputClauseRequirement(final QName typeRef, final Definitions definitions, final List<ClauseRequirement> inputClauseRequirements, final String text) { if (isBuiltInType(typeRef.getLocalPart())) { inputClauseRequirements.add(new ClauseRequirement(text, typeRef)); return; } definitions.getItemDefinition() .stream() .filter(typeRefIsCustom(typeRef)) .findFirst() .ifPresent(itemDefinition -> addInputClauseRequirement(itemDefinition, inputClauseRequirements, text)); } DecisionTableEditorDefinitionEnricher(); @Inject  DecisionTableEditorDefinitionEnricher(final SessionManager sessionManager,
                                                 final DMNGraphUtils dmnGraphUtils,
                                                 final ItemDefinitionUtils itemDefinitionUtils); @Override void enrich(final Optional<String> nodeUUID,
                       final HasExpression hasExpression,
                       final Optional<DecisionTable> expression);  }### Answer:
@Test public void testAddInputClauseRequirement() { final List<DecisionTableEditorDefinitionEnricher.ClauseRequirement> inputClauseRequirements = new ArrayList<>(); final String inputData = "InputData"; final DecisionTableEditorDefinitionEnricher enricher = new DecisionTableEditorDefinitionEnricher(null, null, itemDefinitionUtils); final ItemDefinition tPerson = mockTPersonStructure(); enricher.addInputClauseRequirement(tPerson, inputClauseRequirements, inputData); assertEquals(2, inputClauseRequirements.size()); final DecisionTableEditorDefinitionEnricher.ClauseRequirement inputClause1 = inputClauseRequirements.get(0); final DecisionTableEditorDefinitionEnricher.ClauseRequirement inputClause2 = inputClauseRequirements.get(1); assertEquals("InputData.name", inputClause1.text); assertEquals(STRING.getName(), inputClause1.typeRef.getLocalPart()); assertEquals("InputData.age", inputClause2.text); assertEquals(NUMBER.getName(), inputClause2.typeRef.getLocalPart()); }
@Test public void testAddInputClauseRequirementWhenDataTypeIsStructureAndDontHaveFields() { final ItemDefinition tPerson = mock(ItemDefinition.class); final String inputData = "InputData"; final List<DecisionTableEditorDefinitionEnricher.ClauseRequirement> inputClauseRequirements = new ArrayList<>(); final ItemDefinitionUtils itemDefinitionUtils = new ItemDefinitionUtils(mock(DMNGraphUtils.class)); final DecisionTableEditorDefinitionEnricher enricher = new DecisionTableEditorDefinitionEnricher(null, null, itemDefinitionUtils); when(tPerson.getName()).thenReturn(new Name(TYPE_PERSON)); when(tPerson.getTypeRef()).thenReturn(null); when(tPerson.getItemComponent()).thenReturn(emptyList()); enricher.addInputClauseRequirement(tPerson, inputClauseRequirements, inputData); assertEquals(1, inputClauseRequirements.size()); assertEquals("InputData", inputClauseRequirements.get(0).text); assertEquals(TYPE_PERSON, inputClauseRequirements.get(0).typeRef.getLocalPart()); }