Set<ResourceGroup> groups = newHashSet();
//noinspection ConstantConditions
for (String groupFromReqMapping : asList(requestMapping.get().value())) {
if (!isNullOrEmpty(groupFromReqMapping)) {
String groupName = maybeChompLeadingSlash(firstPathSegment(groupFromReqMapping));
groups.add(new ResourceGroup(groupName));
}
}
if (groups.size() > 0) {
return groups;
}
}
return newHashSet(new ResourceGroup(maybeChompLeadingSlash(defaultGroup.toLowerCase())));
}