### Question:
TagsServiceImpl implements TagsService { @Override public Boolean isValidNumOfUniqueTags(List<String> tagNames) { Set<String> tagsSet = new HashSet<>(tagNames); if (tagsSet.size() < tagNames.size()) { throw new DuplicatedTagException(ErrorMessage.DUPLICATED_TAG); } if (tagsSet.size() > ValidationConstants.MAX_AMOUNT_OF_TAGS) { throw new InvalidNumOfTagsException(ErrorMessage.INVALID_NUM_OF_TAGS); } return true; }  @Override List<Tag> findEcoNewsTagsByNames(List<String> ecoNewsTagNames); @Override List<Tag> findTipsAndTricksTagsByNames(List<String> tipsAndTricksTagNames); @Override List<String> findAllEcoNewsTags(); @Override List<String> findAllTipsAndTricksTags(); @Override Boolean isAllTipsAndTricksValid(List<String> tipsAndTricksTagNames); @Override Boolean isValidNumOfUniqueTags(List<String> tagNames);  }### Answer:
@Test void isValidNumOfUniqueTagsTrueTest() { String name = ModelUtils.getTag().getName(); assertEquals(true, tagService.isValidNumOfUniqueTags(Collections.singletonList(name))); }
@Test void isValidNumOfUniqueTagsDuplicatedTagExceptionTest() { String name = ModelUtils.getTag().getName(); List<String> tipsAndTricksTagsNames = Arrays.asList(name, name); assertThrows(DuplicatedTagException.class, () -> tagService.isValidNumOfUniqueTags(tipsAndTricksTagsNames)); }
@Test void isValidNumOfUniqueTagsInvalidNumOfTagsException() { List<String> tipsAndTricksTagsNames = Arrays.asList("name1", "name2", "name3", "name4"); assertThrows(InvalidNumOfTagsException.class, () -> tagService.isValidNumOfUniqueTags(tipsAndTricksTagsNames)); }