public long computeInflightTotalDiff() {
        long diffTotal = 0L;
        for (Entry<MessageQueue, OffsetWrapper> entry : this.offsetTable.entrySet()) {
            diffTotal += entry.getValue().getPullOffset() - entry.getValue().getConsumerOffset();
        }
        return diffTotal;
    }
@Test
    public void testComputeInflightTotalDiff() {
        ConsumeStats stats = new ConsumeStats();
        MessageQueue messageQueue = Mockito.mock(MessageQueue.class);
        OffsetWrapper offsetWrapper = Mockito.mock(OffsetWrapper.class);
        Mockito.when(offsetWrapper.getBrokerOffset()).thenReturn(3L);
        Mockito.when(offsetWrapper.getPullOffset()).thenReturn(2L);
        stats.getOffsetTable().put(messageQueue, offsetWrapper);

        MessageQueue messageQueue2 = Mockito.mock(MessageQueue.class);
        OffsetWrapper offsetWrapper2 = Mockito.mock(OffsetWrapper.class);
        Mockito.when(offsetWrapper.getBrokerOffset()).thenReturn(3L);
        Mockito.when(offsetWrapper.getPullOffset()).thenReturn(2L);
        stats.getOffsetTable().put(messageQueue2, offsetWrapper2);
        Assert.assertEquals(2L, stats.computeInflightTotalDiff());
    }