### Question:
GroupCountService extends AbstractDaemonService implements CountService { @Override public void add(Map<String, CountItem> counterGroup) { CountSet countSet = countSets[index.get()]; countSet.refCnt.incrementAndGet(); ConcurrentHashMap<String, CountItem> counters = countSet.counterItem; for (Entry<String, CountItem> entry : counterGroup.entrySet()) { CountItem currData = counters.get(entry.getKey()); if (currData == null) { CountItem tmpData = new CountItem(0L, 0L); currData = counters.putIfAbsent(entry.getKey(), tmpData); if (currData == null) { currData = tmpData; } } currData.appendMsg(entry.getValue().getMsgCount(), entry.getValue().getMsgSize()); } countSet.refCnt.decrementAndGet(); } GroupCountService(String logFileName, String countType, long scanIntervalMs); @Override void close(long waitTimeMs); @Override void add(Map<String, CountItem> counterGroup); @Override void add(String name, Long delta, int msgSize);  }### Answer:
@Test public void add() { GroupCountService groupCountService = new GroupCountService("PutCounterGroup", "Producer", 60 * 1000); groupCountService.add("key", 1L, 100); Map<String, CountItem> items = new HashMap<>(); items.put("key1", new CountItem(1L, 1024)); items.put("key2", new CountItem(1L, 1024)); groupCountService.add(items); }