@Transactional
	public SortedSet<Tag> addTags(User user, String[] tags) {
		if (ArrayUtils.isEmpty(tags)) {
			return new TreeSet<>();
		}

		Specification<Tag> spec = Specification.where(lastModifiedOrCreatedBy(user)).and(valueIn(tags));
		List<Tag> foundTags = tagRepository.findAll(spec);
		SortedSet<Tag> allTags = new TreeSet<>(foundTags);
		for (String each : tags) {
			Tag newTag = new Tag(StringUtils.trimToEmpty(StringUtils.replace(each, ",", "")));
			if (allTags.contains(newTag)) {
				continue;
			}
			if (!foundTags.contains(newTag) && !allTags.contains(newTag)) {
				allTags.add(saveTag(user, newTag));
			}
		}
		return allTags;
	}
Add tags.

@param user user
@param tags tag string list
@return inserted tags
ngrinder-controller/src/main/java/org/ngrinder/perftest/service/TagService.java