public void clearInFlightMessageNum(String topic, String group, int queueId) {
        topicInFlightMessageNum.computeIfPresent(buildKey(topic, group), (key, queueNum) -> {
            queueNum.computeIfPresent(queueId, (queueIdKey, counter) -> null);
            if (queueNum.isEmpty()) {
                return null;
            }
            return queueNum;
        });
    }
@Test
    public void testClearInFlightMessageNum() {
        BrokerController brokerController = mock(BrokerController.class);
        long brokerStartTime = System.currentTimeMillis();
        when(brokerController.getShouldStartTime()).thenReturn(brokerStartTime);
        PopInflightMessageCounter counter = new PopInflightMessageCounter(brokerController);

        final String topic = "topic";
        final String group = "group";

        assertEquals(0, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.incrementInFlightMessageNum(topic, group, 0, 3);
        assertEquals(3, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.clearInFlightMessageNumByTopicName("errorTopic");
        assertEquals(3, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.clearInFlightMessageNumByTopicName(topic);
        assertEquals(0, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.incrementInFlightMessageNum(topic, group, 0, 3);
        assertEquals(3, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.clearInFlightMessageNumByGroupName("errorGroup");
        assertEquals(3, counter.getGroupPopInFlightMessageNum(topic, group, 0));

        counter.clearInFlightMessageNumByGroupName(group);
        assertEquals(0, counter.getGroupPopInFlightMessageNum(topic, group, 0));
    }