Collection<CallSession> sessions = userSessionMap.get(username); if(sessions == null) { sessions = Collections.synchronizedList(new ArrayList<CallSession>()); userSessionMap.put(username, sessions); }
Collection<CallSession> sessions = userSessionMap.get(username); if (sessions == null) { sessions = Collections.synchronizedList(new ArrayList<CallSession>()); userSessionMap.put(username, sessions); }  if(!sessions.contains(session)) {
    public CallSession getCallSession(String id, String username) {        CallSession session = sessionMap.get(id);        if(session == null) {            session = new CallSession(id, username);            sessionMap.put(id, session);            Collection<CallSession> sessions = userSessionMap.get(username);            if(sessions == null) {                sessions = Collections.synchronizedList(new ArrayList<CallSession>());                userSessionMap.put(username, sessions);            }            sessions.add(session);        }        return session;    }