### Question:
QueueManager { public Message receiveMessage() { if (messagePriorityMessageQueue.isEmpty()) { return null; } return messagePriorityMessageQueue.remove(); } QueueManager(int initialCapacity); void publishMessage(Message message); Message receiveMessage();  }### Answer:
@Test public void receiveMessage() { var queueManager = new QueueManager(2); var testMessage1 = new Message("Test Message 1", 1); queueManager.publishMessage(testMessage1); var testMessage2 = new Message("Test Message 2", 2); queueManager.publishMessage(testMessage2); var recivedMessage = queueManager.receiveMessage(); assertEquals(testMessage2, recivedMessage); }