### Question:
ClientTranslationService extends AbstractTranslationService { @Override public Optional<String> getElementName(final String uuid) { return getNameProvider(uuid) .map(nameProvider -> nameProvider.getElementName(uuid)) .orElse(Optional.of(defaultElementName(uuid))); } @Inject  ClientTranslationService(final TranslationService erraiTranslationService,
                                    final ManagedInstance<DiagramElementNameProvider> elementNameProviders,
                                    final SessionManager sessionManager,
                                    final DefinitionUtils definitionUtils); @Override String getValue(final String key); String getNotNullValue(final String key); @Override String getValue(final String key,
                           final Object... args); @Override String getViolationMessage(final RuleViolation ruleViolation); @Override Optional<String> getElementName(final String uuid);  }### Answer:
@Test public void getElementName() { final Optional<String> elementName = tested.getElementName(UUID); assertTrue(elementName.isPresent()); assertEquals(NAME, elementName.get()); }
@Test public void getElementNameNull() { final Optional<String> elementName = tested.getElementName("unknown"); assertFalse(elementName.isPresent()); }