public void testReplaceEmpty() throws Exception {
    mockInitialQueue_.hasPendingMessages();
    controlInitialQueue_.setReturnValue(false);
    controlInitialQueue_.replay();
    controlReplacementQueue_.replay();

    objectUnderTest_.replaceDelegate(mockReplacementQueue_);
  }
  public void testReplaceNonEmpty() throws Exception {
    final MockControl controlMessage = MockControl.createControl(Message.class);
    final Message mockMessage = (Message) controlMessage.getMock();
    final Message[] mesgs = new Message[] {mockMessage};

    mockInitialQueue_.hasPendingMessages();
    controlInitialQueue_.setReturnValue(true);

    mockInitialQueue_.getAllMessages();
    controlInitialQueue_.setReturnValue(mesgs);

    controlInitialQueue_.replay();

    mockReplacementQueue_.enqeue(mockMessage);

    controlReplacementQueue_.replay();

    objectUnderTest_.replaceDelegate(mockReplacementQueue_);
  }