### Question:
StationMessageSender { public void sendHeartBeatAndSubscribe(HeartbeatRequest heartbeatRequest, Subscriber<HeartbeatRequest, HeartbeatResponse> subscriber) { Call call = createAndRegisterCall(ActionType.HEARTBEAT, heartbeatRequest); callRegistry.addSubscription(call.getMessageId(), heartbeatRequest, subscriber); sendMessage(OcppMessage.builder().data(call.toJson()).build()); } StationMessageSender(SubscriptionRegistry subscriptionRegistry, StationStore stationStore, WebSocketClient webSocketClient); void sendNotifyMonitoringReport(Integer requestId, Map<ComponentVariable, List<SetMonitoringDatum>> monitoringResult); void sendNotifyEvent(List<EventDatum> eventData); void sendTransactionEventStart(Integer evseId, TransactionEventRequest.TriggerReason reason, String tokenId); void sendTransactionEventStart(Integer evseId, Integer connectorId, Integer remoteStartId, TransactionEventRequest.TriggerReason reason); void sendTransactionEventStart(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, TransactionData.ChargingState chargingState); void sendTransactionEventUpdate(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, TransactionData.ChargingState chargingState); void sendTransactionEventUpdate(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, TransactionData.ChargingState chargingState, Long powerConsumed); void sendTransactionEventUpdate(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, String tokenId, TransactionData.ChargingState chargingState); void sendTransactionEventUpdate(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, String tokenId, TransactionData.ChargingState chargingState, Long powerConsumed); void sendTransactionEventEndedAndSubscribe(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason reason, TransactionData.StoppedReason stoppedReason,
                                                      long powerConsumed, Subscriber<TransactionEventRequest, TransactionEventResponse> subscriber); void sendTransactionEventEnded(Integer evseId, Integer connectorId, TransactionEventRequest.TriggerReason triggerReason, TransactionData.StoppedReason stoppedReason, long powerConsumed); void sendAuthorizeAndSubscribe(String tokenId, List<Integer> evseIds, Subscriber<AuthorizeRequest, AuthorizeResponse> subscriber); void sendBootNotificationAndSubscribe(BootNotificationRequest.Reason reason, Subscriber<BootNotificationRequest, BootNotificationResponse> subscriber); void sendBootNotification(BootNotificationRequest.Reason reason); void sendStatusNotificationAndSubscribe(Evse evse, Connector connector, Subscriber<StatusNotificationRequest, StatusNotificationResponse> subscriber); void sendStatusNotification(int evseId, int connectorId); void sendStatusNotification(int evseId, int connectorId, StatusNotificationRequest.ConnectorStatus connectorStatus); void sendDataTransfer(List<Integer> evseIds); void sendStatusNotification(Evse evse, Connector connector); void sendHeartBeatAndSubscribe(HeartbeatRequest heartbeatRequest, Subscriber<HeartbeatRequest, HeartbeatResponse> subscriber); void sendNotifyReport(@Nullable Integer requestId, boolean tbc, int seqNo, ZonedDateTime generatedAt, List<ReportDatum> reportData); void sendSignCertificateRequest(String csr); void sendNotifyCustomerInformationRequest(final NotifyCustomerInformationRequest request); void sendMessage(AbstractWebSocketClientInboxMessage message); void sendCallResult(String callId, Object payload); void sendCallError(String callId, CallError.Code errorCode, Object payload); Map<String, Call> getSentCalls(); LocalDateTime getTimeOfLastMessageSent();  }### Answer:
@Test void verifyHeartBeat() throws InterruptedException, JsonProcessingException { HeartbeatRequest heartbeatRequest = new HeartbeatRequest(); stationMessageSender.sendHeartBeatAndSubscribe(heartbeatRequest, DEFAULT_SUBSCRIBER); AbstractWebSocketClientInboxMessage actualMessage = queue.take(); String expectedCall = createCall() .withMessageId(DEFAULT_MESSAGE_ID) .withAction(HEART_BEAT_ACTION) .withPayload(new HeartbeatRequest()) .toJson(); assertThat(actualMessage.getData().get()).isEqualTo(expectedCall); }