### Question:
LabelService implements ILabelService { @Override public LabelDto updateLabelGroup(LabelDto labelRequest) { try { String code = labelRequest.getKey(); ApsProperties labelGroup = this.getI18nManager().getLabelGroup(code); if (null == labelGroup) { logger.warn("no label found with key {}", code); throw new ResourceNotFoundException(LabelValidator.ERRCODE_LABELGROUP_NOT_FOUND, "label", code); } BeanPropertyBindingResult validationResult = this.validateUpdateLabelGroup(labelRequest); if (validationResult.hasErrors()) { throw new ValidationGenericException(validationResult); } ApsProperties languages = new ApsProperties(); languages.putAll(labelRequest.getTitles()); this.getI18nManager().updateLabelGroup(code, languages); return labelRequest; } catch (ApsSystemException t) { logger.error("error in update label group with code {}", labelRequest.getKey(), t); throw new RestServerError("error in update label group", t); } }  void setI18nManager(II18nManager i18nManager); void setLangManager(ILangManager langManager); @SuppressWarnings({"rawtypes", "unchecked"}) @Override PagedMetadata<LabelDto> getLabelGroups(final RestListRequest restRequest); @Override LabelDto getLabelGroup(String code); @Override LabelDto updateLabelGroup(LabelDto labelRequest); @Override LabelDto addLabelGroup(LabelDto labelRequest); @Override void removeLabelGroup(String code);  }### Answer:
@Test public void testUpdateLabelGroup() throws ApsSystemException { when(langManager.getDefaultLang()).thenReturn(lang); when(langManager.getAssignableLangs()).thenReturn(singletonList(lang)); when(langManager.getLangs()).thenReturn(singletonList(lang)); when(i18nManager.getLabelGroup(eq("lab"))).thenReturn(create(singletonMap("EN", "some_value"))); final LabelDto label = new LabelDto("lab", singletonMap("EN", "another_value")); final LabelDto labelResult = labelService.updateLabelGroup(label); ArgumentCaptor<ApsProperties> captor = ArgumentCaptor.forClass(ApsProperties.class); verify(i18nManager, times(1)).getLabelGroup(eq("lab")); verify(i18nManager, times(1)).updateLabelGroup(eq("lab"), captor.capture()); final ApsProperties value = captor.getValue(); assertThat(value.getProperty("EN")).isEqualTo("another_value"); assertThat(labelResult.getKey()).isEqualTo("lab"); assertThat(labelResult.getTitles()).hasSize(1); assertThat(labelResult.getTitles()).containsOnly(entry("EN", "another_value")); }