### Question:
LabelService implements ILabelService { @Override public LabelDto getLabelGroup(String code) { try { 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); } return this.getDtoBuilder().convert(code, labelGroup); } catch (ApsSystemException t) { logger.error("error in get label group with code {}", code, t); throw new RestServerError("error in get 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(expected = ResourceNotFoundException.class) public void testGetLabelGroupNotFound() throws ApsSystemException { when(i18nManager.getLabelGroup(eq("not_found"))).thenReturn(null); labelService.getLabelGroup("not_found"); verify(i18nManager, times(1)).getLabelGroup(eq("not_found")); }
@Test public void testGetLabelGroup() throws ApsSystemException { when(i18nManager.getLabelGroup(eq("lab"))).thenReturn(create(singletonMap("EN", "some_value"))); final LabelDto label = labelService.getLabelGroup("lab"); assertThat(label.getKey()).isEqualTo("lab"); assertThat(label.getTitles()).hasSize(1); assertThat(label.getTitles()).containsOnly(entry("EN", "some_value")); verify(i18nManager, times(1)).getLabelGroup(eq("lab")); }