for (Activity activity : activities)
{
int y = activity.getStart().getYear();
int m = activity.getStart().getMonth();
int w = activity.getStart().getWeek();
Year year = lookup.get(y);
if (year == null)
{
year = new Year(y);
lookup.put(y, year);
}
year.addMonth(m);
year.addWeek(w);
}
Years years = new Years(new TreeSet<Year>(lookup.values()));
String url = uriInfo.getAbsolutePath().toASCIIString();
LinkHeader linkHeader = new LinkHeader().addLink(null, SELF, url, null);