### Question:
DecisionTableEditorDefinitionEnricher implements ExpressionEditorModelEnricher<DecisionTable> { String computeClauseName(final ItemDefinition itemComponent) { final String originalName = itemComponent.getName().getValue(); String nameWithoutModelRef = originalName; if (itemComponent.isImported()) { final int positionOfLastDot = originalName.lastIndexOf(DOT_CHAR) + 1; if (positionOfLastDot > 0 && positionOfLastDot != originalName.length()) { nameWithoutModelRef = originalName.substring(positionOfLastDot); } } return nameWithoutModelRef; } 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 testComputingClauseNameWithoutModelRef() { final ItemDefinition itemComponent = new ItemDefinition(); itemComponent.setName(new Name("model.age")); itemComponent.setAllowOnlyVisualChange(true); assertEquals("age", new DecisionTableEditorDefinitionEnricher(null, null, null) .computeClauseName(itemComponent)); }
@Test public void testComputingClauseNameWithoutModelRefWhenModelRefHasMultipleLevels() { final ItemDefinition itemComponent = new ItemDefinition(); itemComponent.setName(new Name("a.b.c.age")); itemComponent.setAllowOnlyVisualChange(true); assertEquals("age", new DecisionTableEditorDefinitionEnricher(null, null, null) .computeClauseName(itemComponent)); }
@Test public void testComputingClauseNameWithoutModelRefWhenModelRefAlreadyMissing() { final ItemDefinition itemComponent = new ItemDefinition(); itemComponent.setName(new Name("age")); itemComponent.setAllowOnlyVisualChange(true); assertEquals("age", new DecisionTableEditorDefinitionEnricher(null, null, null) .computeClauseName(itemComponent)); }
@Test public void testComputingClauseNameWithoutModelRefWhenLocalPartEndsWithDot() { final ItemDefinition itemComponent = new ItemDefinition(); itemComponent.setName(new Name("age.")); itemComponent.setAllowOnlyVisualChange(true); assertEquals("age.", new DecisionTableEditorDefinitionEnricher(null, null, null) .computeClauseName(itemComponent)); }