### Question:
DeFiBusConsumeStats extends RemotingSerializable { public long computeTotalDiff() { long diffTotal = 0L; Iterator<Map.Entry<MessageQueue, DeFiBusOffsetWrapper>> it = this.offsetTable.entrySet().iterator(); while (it.hasNext()) { Map.Entry<MessageQueue, DeFiBusOffsetWrapper> next = it.next(); long diff = next.getValue().getBrokerOffset() - next.getValue().getConsumerOffset(); diffTotal += diff; } return diffTotal; }  long computeTotalDiff(); HashMap<MessageQueue, DeFiBusOffsetWrapper> getOffsetTable(); void setOffsetTable(HashMap<MessageQueue, DeFiBusOffsetWrapper> offsetTable); double getConsumeTps(); void setConsumeTps(double consumeTps);  }### Answer:
@Test public void testComputeTotalDiff() throws Exception { long totalDiff = createOffsetTable(10); deFiBusConsumeStats.setOffsetTable(offsetTable); long i = deFiBusConsumeStats.computeTotalDiff(); assertTrue(totalDiff == deFiBusConsumeStats.computeTotalDiff()); }