Set<String> () { if (!TestType.GROUP.getType().equals(data.TEST_OBJECT)) { return null; } Set<String> groups = StringUtil.split(data.getGroupName(), ",").stream() .map(String::trim) .filter(StringUtil::isNotEmpty) .collect(Collectors.toSet()); return groups.isEmpty() ? null : groups; }