### Question:
MqResource implements IMqResource { public void setUrls(List<String> urlsTempG1, List<String> urlsTempG2) { if (urlsTempG1 == null) { urlsTempG1 = new ArrayList<>(); } if (urlsTempG2 == null) { urlsTempG2 = new ArrayList<>(); } urlsG1.set(urlsTempG1); urlsG2.set(urlsTempG2); if (urlsTempG1.size() > 0) { int count = ((new BigDecimal(Math.random())).multiply(new BigDecimal(urlsTempG1.size()))).intValue(); counterG1.set(count); } if (urlsTempG2.size() > 0) { int count = ((new BigDecimal(Math.random())).multiply(new BigDecimal(urlsTempG2.size()))).intValue(); counterG2.set(count); } failUrlG1.clear(); failUrlG2.clear(); } MqResource(String url, long connectionTimeOut, long readTimeOut);  MqResource(IHttpClient httpClient, String url); void setUrls(List<String> urlsTempG1, List<String> urlsTempG2); long register(ConsumerRegisterRequest request); void publishAndUpdateResultFailMsg(FailMsgPublishAndUpdateResultRequest request); void deRegister(ConsumerDeRegisterRequest request); GetMetaGroupResponse getMetaGroup(GetMetaGroupRequest request); GetTopicResponse getTopic(GetTopicRequest request); GetGroupTopicResponse getGroupTopic(GetGroupTopicRequest request); void addCat(CatRequest request); boolean publish(PublishMessageRequest request); boolean publish(PublishMessageRequest request, int retryTimes); void commitOffset(CommitOffsetRequest request); ConsumerGroupRegisterResponse registerConsumerGroup(ConsumerGroupRegisterRequest request); void heartbeat(HeartbeatRequest request); GetConsumerGroupResponse getConsumerGroup(GetConsumerGroupRequest request); GetMessageCountResponse getMessageCount(GetMessageCountRequest request); PullDataResponse pullData(PullDataRequest request); GetTopicQueueIdsResponse getTopicQueueIds(GetTopicQueueIdsRequest request); void addLog(LogRequest request); void addOpLog(OpLogRequest request); void sendMail(SendMailRequest request); @Override String getBrokerIp();  }### Answer:
@Test public void setUrlsNullTest() { MqResource mqResource = new MqResource("http: mqResource.setUrls(null, null); AtomicReference<List<String>> urlsG1 = getValue("urlsG1", mqResource); AtomicReference<List<String>> urlsG2 = getValue("urlsG2", mqResource); Map<String, Long> failUrlG1 = getValue("failUrlG1", mqResource); Map<String, Long> failUrlG2 = getValue("failUrlG1", mqResource); assertEquals("setUrlsNullTest null", 0, urlsG1.get().size()); assertEquals("setUrlsNullTest null", 0, urlsG2.get().size()); assertEquals("setUrlsNullTest null", 0, failUrlG1.size()); assertEquals("setUrlsNullTest null", 0, failUrlG2.size()); }
@Test public void setUrlsNotNullTest() { MqResource mqResource = new MqResource("http: mqResource.setUrls(Arrays.asList("1", "1", "1"), Arrays.asList("1", "1", "1")); AtomicReference<List<String>> urlsG1 = getValue("urlsG1", mqResource); AtomicReference<List<String>> urlsG2 = getValue("urlsG2", mqResource); Map<String, Long> failUrlG1 = getValue("failUrlG1", mqResource); Map<String, Long> failUrlG2 = getValue("failUrlG1", mqResource); assertEquals("setUrlsNullTest null", 3, urlsG1.get().size()); assertEquals("setUrlsNullTest null", 3, urlsG2.get().size()); assertEquals("setUrlsNullTest null", 0, failUrlG1.size()); assertEquals("setUrlsNullTest null", 0, failUrlG2.size()); }