public TopicStatsTable getTopicStatsInfo(final String addr, final String topic,
        final long timeoutMillis) throws InterruptedException,
        RemotingTimeoutException, RemotingSendRequestException, RemotingConnectException, MQBrokerException {
        GetTopicStatsInfoRequestHeader requestHeader = new GetTopicStatsInfoRequestHeader();
        requestHeader.setTopic(topic);

        RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_TOPIC_STATS_INFO, requestHeader);

        RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr),
            request, timeoutMillis);
        switch (response.getCode()) {
            case ResponseCode.SUCCESS: {
                TopicStatsTable topicStatsTable = TopicStatsTable.decode(response.getBody(), TopicStatsTable.class);
                return topicStatsTable;
            }
            default:
                break;
        }

        throw new MQBrokerException(response.getCode(), response.getRemark(), addr);
    }
@Test
    public void assertGetTopicStatsInfo() throws RemotingException, InterruptedException, MQBrokerException {
        mockInvokeSync();
        TopicStatsTable responseBody = new TopicStatsTable();
        MessageQueue messageQueue = new MessageQueue();
        TopicOffset topicOffset = new TopicOffset();
        responseBody.getOffsetTable().put(messageQueue, topicOffset);
        setResponseBody(responseBody);
        TopicStatsTable actual = mqClientAPI.getTopicStatsInfo(defaultBrokerAddr, defaultTopic, defaultTimeout);
        assertNotNull(actual);
        assertEquals(1, actual.getOffsetTable().size());
    }