packagechatRoom;importjava.net.ServerSocket;importjava.net.Socket;importjava.util.ArrayList;publicclassMultiServer{publicstaticvoidmain(Stringargv[])throwsException{MultiQueueq=newMultiQueue();ArrayList<MultiServerThreadFromClient>tList=newArrayList<MultiServerThreadFromClient>();// Thread that consumes from the queue containing messages from the different clientsMultiServerThreadToClientsmstc=newMultiServerThreadToClients(tList,q);mstc.start();ServerSocketwelcomeSocket=newServerSocket(6789);SocketclientSocket;MultiServerThreadFromClientmsfc;intidCounter=0;System.out.println("Ready to receive messages");while(true){clientSocket=welcomeSocket.accept();idCounter++;// Thread that reads the message from a client and queues it to be forwarded to other clientsmsfc=newMultiServerThreadFromClient(clientSocket,q,idCounter);tList.add(msfc);msfc.start();}}}