private void mockLeave(MockRoomMember member) { synchronized (members) { if (!members.remove(member)) { throw new RuntimeException("Member is not in the room " + member); } fireMemberPresenceEvent(member, member, ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT, null); } }
@Override public void leave() { if (!isJoined) return; isJoined = false; synchronized (members) { members.remove(me); fireMemberPresenceEvent(me, me, ChatRoomMemberPresenceChangeEvent.MEMBER_LEFT, null); } me = null; }