@Test
    public void testSendMessageToListWithQueue() {
        LOGGER.log(Level.INFO, "----- STARTING TEST testSendMessageToListWithQueue -----");
        String client_hash = "";
        String client_hash2 = "";
        String server_hash = "";
        String server_hash2 = "";
        try {
            server1.setUseMessageQueues(true);
        } catch (TimeoutException e) {
            exception = true;
        }
        try {
            server1.startThread();
        } catch (IOException | ServerSocketCloseException | FeatureNotUsedException e) {
            exception = true;
        }
        waitListenThreadStart(server1);
        Assert.assertTrue(server1.getListenThread().getRun(), "ListenThread did not start in time");
        try {
            client_hash = server2.addSocket("127.0.0.1", port);
        } catch (IOException | TimeoutException e) {
            exception = true;
        }
        waitSocketThreadAddNotEmpty(server2);
        waitSocketThreadAddNotEmpty(server1);
        server_hash = getServerLastSocketHash(server1);
        waitSocketThreadState(server1, server_hash, SocketThread.CONFIRMED);
        waitMessageQueueAddNotEmpty(server1);
        waitMessageQueueState(server1, server_hash, MessageQueue.RUNNING);
        try {
            client_hash2 = server2.addSocket("127.0.0.1", port);
        } catch (IOException | TimeoutException e) {
            exception = true;
        }
        waitSocketThreadState(server2, client_hash2, SocketThread.CONFIRMED);
        boolean loop = true;
        Timing new_timer = new Timing();
        while (loop) {
            if (server1.getSocketList().size() == 2) {
                loop = false;
            } else if (new_timer.getTime() > 5000) {
                exception = true;
                loop = false;
            }
        }
        Assert.assertFalse(exception, "SocketThread was not added to server1");
        for (SocketThread socket : server1.getSocketList().values()) {
            if (socket.getHash().compareTo(server_hash) != 0) {
                server_hash2 = socket.getHash();
            }
        }
        waitSocketThreadState(server1, server_hash2, SocketThread.CONFIRMED);
        waitMessageQueueState(server1, server_hash2, MessageQueue.RUNNING);
        ArrayList<String> sockets = new ArrayList<String>();
        sockets.add(server_hash);
        sockets.add(server_hash2);
        server1.sendMessage("TEST", sockets);
        waitTime();
        Assert.assertTrue(server1.containsHash(server_hash), "Socket1 on server1 has closed");
        Assert.assertTrue(server1.containsHash(server_hash2), "Socket2 on server1 has closed");
        Assert.assertTrue(server2.containsHash(client_hash), "Socket1 on server2 has closed");
        Assert.assertTrue(server2.containsHash(client_hash2), "Socket2 on server2 has closed");
        Assert.assertFalse(server1.getQueueList().get(server_hash).getMessages().contains("TEST"), "Message was not sent on socket1");
        Assert.assertFalse(server1.getQueueList().get(server_hash2).getMessages().contains("TEST"), "Message was not sent on socket2");
        Assert.assertFalse(exception, "Exception found");
        LOGGER.log(Level.INFO, "----- TEST testSendMessageToListWithQueue COMPLETED -----");
    }