### Question:
ConsumerCommitServiceImpl implements ConsumerCommitService, BrokerTimerService { protected void clearOldData() { boolean flag = (System.currentTimeMillis() - lastTime - 10 * 60 * 1000) > 0; if (flag) { synchronized (lockObj) { if ((System.currentTimeMillis() - lastTime - 30 * 60 * 1000) > 0) { mapAppPolling.set(new ConcurrentHashMap<>(failMapAppPolling)); failMapAppPolling.clear(); lastTime = System.currentTimeMillis(); } } } }  @Override void startBroker(); @Override CommitOffsetResponse commitOffset(CommitOffsetRequest request); @Override void stopBroker(); @Override String info(); @Override Map<Long, ConsumerQueueVersionDto> getCache();  }### Answer:
@Test public void clearOldDataTest() { consumerCommitServiceImpl.lastTime=1L; consumerCommitServiceImpl.failMapAppPolling.put(1L, new ConsumerQueueVersionDto()); consumerCommitServiceImpl.clearOldData(); assertEquals(1, consumerCommitServiceImpl.mapAppPolling.get().size()); assertEquals(0, consumerCommitServiceImpl.failMapAppPolling.size()); }