@Override
    protected void reportActivity(UUID sessionId, TransportProtos.SessionInfoProto currentSessionInfo, long timeToReport, ActivityReportCallback<UUID> callback) {
        log.debug("Reporting activity state for session with id: [{}]. Time to report: [{}].", sessionId, timeToReport);
        SessionMetaData session = sessions.get(sessionId);
        TransportProtos.SubscriptionInfoProto subscriptionInfo = TransportProtos.SubscriptionInfoProto.newBuilder()
                .setAttributeSubscription(session != null && session.isSubscribedToAttributes())
                .setRpcSubscription(session != null && session.isSubscribedToRPC())
                .setLastActivityTime(timeToReport)
                .build();
        TransportProtos.SessionInfoProto sessionInfo = session != null ? session.getSessionInfo() : currentSessionInfo;
        process(sessionInfo, subscriptionInfo, new TransportServiceCallback<>() {
            @Override
            public void onSuccess(Void msgAcknowledged) {
                callback.onSuccess(sessionId, timeToReport);

            }

            @Override
            public void onError(Throwable e) {
                callback.onFailure(sessionId, e);
            }
        });
    }
@Test
    void givenKeyAndTimeToReportAndSessionExists_whenReportingActivity_thenShouldReportActivityWithSubscriptionsAndSessionInfoFromSession() {
        // GIVEN
        long expectedTime = 123L;
        boolean expectedAttributesSubscription = true;
        boolean expectedRPCSubscription = true;
        TransportProtos.SessionInfoProto expectedSessionInfo = TransportProtos.SessionInfoProto.getDefaultInstance();

        SessionMsgListener listenerMock = mock(SessionMsgListener.class);
        SessionMetaData session = new SessionMetaData(expectedSessionInfo, TransportProtos.SessionType.ASYNC, listenerMock);
        session.setSubscribedToAttributes(expectedAttributesSubscription);
        session.setSubscribedToRPC(expectedRPCSubscription);
        sessions.put(SESSION_ID, session);

        ActivityReportCallback<UUID> callbackMock = mock(ActivityReportCallback.class);

        TransportProtos.SessionInfoProto sessionInfo = TransportProtos.SessionInfoProto.newBuilder()
                .setSessionIdMSB(SESSION_ID.getMostSignificantBits())
                .setSessionIdLSB(SESSION_ID.getLeastSignificantBits())
                .build();

        doCallRealMethod().when(transportServiceMock).reportActivity(SESSION_ID, sessionInfo, expectedTime, callbackMock);

        // WHEN
        transportServiceMock.reportActivity(SESSION_ID, sessionInfo, expectedTime, callbackMock);

        // THEN
        ArgumentCaptor<TransportProtos.SessionInfoProto> sessionInfoCaptor = ArgumentCaptor.forClass(TransportProtos.SessionInfoProto.class);
        ArgumentCaptor<TransportProtos.SubscriptionInfoProto> subscriptionInfoCaptor = ArgumentCaptor.forClass(TransportProtos.SubscriptionInfoProto.class);
        ArgumentCaptor<TransportServiceCallback<Void>> callbackCaptor = ArgumentCaptor.forClass(TransportServiceCallback.class);

        verify(transportServiceMock).process(sessionInfoCaptor.capture(), subscriptionInfoCaptor.capture(), callbackCaptor.capture());

        assertThat(sessionInfoCaptor.getValue()).isEqualTo(expectedSessionInfo);

        TransportProtos.SubscriptionInfoProto expectedSubscriptionInfo = TransportProtos.SubscriptionInfoProto.newBuilder()
                .setAttributeSubscription(expectedAttributesSubscription)
                .setRpcSubscription(expectedRPCSubscription)
                .setLastActivityTime(expectedTime)
                .build();
        assertThat(subscriptionInfoCaptor.getValue()).isEqualTo(expectedSubscriptionInfo);

        TransportServiceCallback<Void> queueCallback = callbackCaptor.getValue();

        queueCallback.onSuccess(null);
        verify(callbackMock).onSuccess(SESSION_ID, expectedTime);

        var throwable = new Throwable();
        queueCallback.onError(throwable);
        verify(callbackMock).onFailure(SESSION_ID, throwable);
    }