### Question:
FieldLayoutComponent implements FormLayoutComponent,
                                             LayoutDragComponent { @Override public String getDragComponentTitle() { String name = ""; if (field.getBinding() != null) { name = field.getBinding(); } else { name = translationService.getTranslation(fieldRenderer.getName()); if (name == null || name.isEmpty()) { name = fieldRenderer.getName(); } } return name; } @Inject  FieldLayoutComponent(FieldRendererManager fieldRendererManager, TranslationService translationService); void init(FormRenderingContext renderingContext,
                     FieldDefinition field); @Override String getDragComponentTitle(); @Override IsWidget getPreviewWidget(RenderingContext ctx); @Override IsWidget getShowWidget(RenderingContext ctx); Optional<IsWidget> getContentPart(String partId, RenderingContext componentContext); void addComponentParts(LayoutComponent component); String getFieldId(); String getFormId(); FieldRenderer getFieldRenderer(); FieldDefinition getField(); @PreDestroy void destroy();  }### Answer:
@Test public void testGetDragComponentTitle() { String result = component.getDragComponentTitle(); verify(renderer, never()).getName(); verify(translationService, never()).getTranslation(anyString()); Assertions.assertThat(result) .isEqualTo(NAME); }
@Test public void testUnBoundGetDragComponentTitleWithTranslation() { field.setBinding(null); component.getDragComponentTitle(); verify(renderer, times(2)).getName(); verify(translationService).getTranslation(anyString()); }
@Test public void testUnBoundGetDragComponentTitleWithoutTranslation() { when(translationService.getTranslation(anyString())).thenReturn(NAME); field.setBinding(null); component.getDragComponentTitle(); verify(renderer).getName(); verify(translationService).getTranslation(anyString()); }