### Question:
ConsumerGroupConsumerCheckServiceImpl implements RedundanceCheckService { @Override public String checkResult() { String result = null; Map<Long, ConsumerGroupEntity> consumerGroupMap = consumerGroupService.getIdCache(); List<ConsumerEntity> consumerList =consumerService.getList(); List<ConsumerGroupConsumerEntity> consumerGroupConsumerList=consumerGroupConsumerService.getList(); Map<Long,ConsumerEntity> consumerMap=new HashMap<>(); for (ConsumerEntity consumer:consumerList) { consumerMap.put(consumer.getId(),consumer); } result = checkConsumerGroupConsumer(consumerGroupMap, consumerMap, consumerGroupConsumerList); return result; }  @Override String checkItem(); @Override String checkResult(); String checkConsumerGroupConsumer(Map<Long, ConsumerGroupEntity> consumerGroupMap,Map<Long,ConsumerEntity> consumerMap,List<ConsumerGroupConsumerEntity> consumerGroupConsumerList);  }### Answer:
@Test public void checkResultTest() { Map<Long, ConsumerGroupEntity> consumerGroupMap=new HashMap<Long, ConsumerGroupEntity>(); consumerGroupMap.put(2L, new ConsumerGroupEntity()); List<ConsumerEntity> consumerList=new ArrayList<ConsumerEntity>(); ConsumerEntity consumerEntity=new ConsumerEntity(); consumerEntity.setId(2L); consumerList.add(consumerEntity); List<ConsumerGroupConsumerEntity> consumerGroupConsumerList=new ArrayList<ConsumerGroupConsumerEntity>(); ConsumerGroupConsumerEntity consumerGroupConsumerEntity=new ConsumerGroupConsumerEntity(); consumerGroupConsumerEntity.setId(1L); consumerGroupConsumerEntity.setConsumerGroupId(3L); consumerGroupConsumerList.add(consumerGroupConsumerEntity); when(consumerGroupService.getIdCache()).thenReturn(consumerGroupMap); when(consumerService.getList()).thenReturn(consumerList); when(consumerGroupConsumerService.getList()).thenReturn(consumerGroupConsumerList); assertEquals(2, search(consumerGroupConsumerCheckServiceImpl.checkResult(),"<br/>")); }