### Question:
RingMessageManager extends AbstractMessageManager { @Override public boolean sendHeartbeatMessage(int leaderId) { var leaderInstance = instanceMap.get(leaderId); var alive = leaderInstance.isAlive(); return alive; } RingMessageManager(Map<Integer, Instance> instanceMap); @Override boolean sendHeartbeatMessage(int leaderId); @Override boolean sendElectionMessage(int currentId, String content); @Override boolean sendLeaderMessage(int currentId, int leaderId); @Override void sendHeartbeatInvokeMessage(int currentId);  }### Answer:
@Test public void testSendHeartbeatMessage() { var instance1 = new RingInstance(null, 1, 1); Map<Integer, Instance> instanceMap = Map.of(1, instance1); var messageManager = new RingMessageManager(instanceMap); assertTrue(messageManager.sendHeartbeatMessage(1)); }