### Question:
DecisionNavigatorBaseItemFactory { String getName(final Element<? extends Definition> element) { final TextPropertyProvider provider = textPropertyProviderFactory.getProvider(element); return provider.getText(element); } @Inject  DecisionNavigatorBaseItemFactory(final DecisionNavigatorNestedItemFactory nestedItemFactory,
                                            final TextPropertyProviderFactory textPropertyProviderFactory,
                                            final CanvasFocusUtils canvasFocusUtils,
                                            final DefinitionUtils definitionUtils,
                                            final TranslationService translationService,
                                            final DMNDiagramsSession dmnDiagramsSession,
                                            final LazyCanvasFocusUtils lazyCanvasFocusUtils,
                                            final Event<DMNDiagramSelected> selectedEvent); DecisionNavigatorItem makeItem(final Node<View, Edge> node,
                                          final DecisionNavigatorItem.Type type);  }### Answer:
@Test public void testGetName() { final TextPropertyProvider provider = mock(TextPropertyProvider.class); final String expectedName = "text"; when(textPropertyProviderFactory.getProvider(element)).thenReturn(provider); when(provider.getText(element)).thenReturn(expectedName); final String actualName = factory.getName(element); assertEquals(expectedName, actualName); }