@Test
    public void testServerUseMessageQueueWithPauseAndResume() {
        LOGGER.log(Level.INFO, "----- STARTING TEST testServerUseMessageQueueWithPauseAndResume -----");
        String client_hash = "";
        try {
            server1.setUseMessageQueues(true);
        } catch (TimeoutException e) {
            exception = true;
        }
        try {
            server2.setUseMessageQueues(true);
        } catch (TimeoutException ex) {
            exception = true;
        }
        try {
            server1.startThread();
        } catch (IOException | ServerSocketCloseException | FeatureNotUsedException e) {
            exception = true;
        }
        waitListenThreadStart(server1);
        try {
            client_hash = server2.addSocket("127.0.0.1", port);
        } catch (IOException | TimeoutException e) {
            exception = true;
        }
        waitSocketThreadAddNotEmpty(server2);
        waitSocketThreadState(server2, client_hash, SocketThread.CONFIRMED);
        waitMessageQueueAddNotEmpty(server2);
        waitMessageQueueState(server2, client_hash, MessageQueue.RUNNING);
        server2.getQueueList().get(client_hash).pauseQueue();
        waitMessageQueueState(server2, client_hash, MessageQueue.PAUSED);
        server2.sendMessage("TEST", client_hash);
        server2.sendMessage("TEST2", client_hash);
        ArrayList<String> test_queue = server2.getQueueList().get(client_hash).getMessages();
        Assert.assertEquals("TEST", test_queue.get(0), "MessageQueue was not paused");
        Assert.assertEquals("TEST2", test_queue.get(1), "MessageQueue was not paused");

        server2.getQueueList().get(client_hash).resumeQueue();
        waitMessageQueueState(server2, client_hash, MessageQueue.RUNNING);
        boolean loop = true;
        Timing new_timer = new Timing();
        while (loop) {
            if (server2.getQueueList().get(client_hash).getMessages().isEmpty() || new_timer.getTime() > 5000) {
                loop = false;
            }
        }
        test_queue = server2.getQueueList().get(client_hash).getMessages();
        Assert.assertTrue(test_queue.isEmpty(), "MessageQueue sending was not resumed");

        Assert.assertFalse(exception, "Exception found");
        LOGGER.log(Level.INFO, "----- TEST testServerUseMessageQueueWithPauseAndResume COMPLETED -----");
    }