private static Set<Activity> getMostActivites(
            final TreeSet<Activity> priorityQueue) {
        final Set<Activity> activities = new HashSet<Activity>();

        Activity lastActivitySelected = priorityQueue.pollFirst();
        activities.add(lastActivitySelected);

        while (!priorityQueue.isEmpty()) {
            Activity top = priorityQueue.pollFirst();
            if (lastActivitySelected.mFinishTime <= top.mStartTime) {
                activities.add(top);
                lastActivitySelected = top;
            }
        }
        return activities;
    }