public void removeById(Long id) {
        if (recommendations.containsKey(id)) {
            Recommendation rec = recommendations.get(id);
            if (inbox.containsKey(rec.getSender().getId()))
                inbox.get(rec.getSender().getId()).remove(rec);
            if (self.containsKey(rec.getSender().getId()))
                self.get(rec.getSender().getId()).remove(rec);
            if (queries.containsKey(rec.getWriter().getId()))
                queries.get(rec.getWriter().getId()).remove(rec);
            recommendations.remove(id);
        }
    }