@Timed
public Collection<Tag> getTags(@RequestParam(required = false, value = "popular") String popular,
@RequestParam(required = false, value = "user") String username,
@RequestParam(required = false, value = "search") String search) {
Collection<Tag> tags = new ArrayList<Tag>();
User currentUser = authenticationService.getCurrentUser();
String domain = DomainUtil.getDomainFromLogin(currentUser.getLogin());
Collection<String> followedTags = userTagRepository.findTags(currentUser.getLogin());
Collection<String> tagNames;
if (popular != null) {
List<Trend> trends;
User user = null;
if (username != null) user = userService.getUserByUsername(username);
if (user != null) {
trendService.getTrendsForUser(user.getLogin());
trends = trendService.getTrendsForUser(user.getLogin());
} else {
trends = trendService.getCurrentTrends(domain);
}
for (Trend trend : trends) {