@Test
 public void testThatMessagesAreReturnedInPriorityOrder() {
   addMessageToQueue(queue, validMessageLowPriority);
   addMessageToQueue(queue, validMessage);
   addMessageToQueue(queue, validMessageMidPriority);
   addMessageToQueue(queue, validMessage);
   assertThat(queue.poll().getInstructionType(), equalTo(10));
   assertThat(queue.poll().getInstructionType(), equalTo(10));
   assertThat(queue.poll().getInstructionType(), equalTo(50));
   assertThat(queue.poll().getInstructionType(), equalTo(99));
 }
 @Test
 public void testThatTheHighestPriorityMessageIsReturnedFromTheQueue() {
   addMessageToQueue(queue, validMessage);
   addMessageToQueue(queue, validMessageMidPriority);
   addMessageToQueue(queue, validMessageLowPriority);
   assertThat(queue.poll().getInstructionType(), equalTo(10));
 }
 @Test
 public void testThatMessagesCanBeRetrievedFromTheQueue() {
   addMessageToQueue(queue, validMessage);
   InstructionMessage polledMessage = queue.poll();
   assertThat(validMessage.getInstructionType(), equalTo(polledMessage.getInstructionType()));
 }