@Override
  public boolean sendElectionMessage(int currentId, String content) {
    var nextInstance = this.findNextInstance(currentId);
    var electionMessage = new Message(MessageType.ELECTION, content);
    nextInstance.onMessage(electionMessage);
    return true;
  }
@Test
  void testSendElectionMessage() {
    try {
      var instance1 = new RingInstance(null, 1, 1);
      var instance2 = new RingInstance(null, 1, 2);
      var instance3 = new RingInstance(null, 1, 3);
      Map<Integer, Instance> instanceMap = Map.of(1, instance1, 2, instance2, 3, instance3);
      var messageManager = new RingMessageManager(instanceMap);
      var messageContent = "2";
      messageManager.sendElectionMessage(2, messageContent);
      var ringMessage = new Message(MessageType.ELECTION, messageContent);
      var instanceClass = AbstractInstance.class;
      var messageQueueField = instanceClass.getDeclaredField("messageQueue");
      messageQueueField.setAccessible(true);
      var ringMessageSent = ((Queue<Message>) messageQueueField.get(instance3)).poll();
      assertEquals(ringMessageSent.getType(), ringMessage.getType());
      assertEquals(ringMessageSent.getContent(), ringMessage.getContent());
    } catch (NoSuchFieldException | IllegalAccessException e) {
      fail("Error to access private field.");
    }
  }