### Question:
AssetGroupStatsCollector implements Constants { public void uploadAssetGroupIssues(Map<String, List<String>> assetGroups) throws Exception { log.info(" Start Collecing issues"); List<Map<String, Object>> docs = new ArrayList<>(); assetGroups.entrySet().stream().forEach(entry -> { String ag = entry.getKey(); List<String> domains = entry.getValue(); try { List<Map<String, Object>> docList = AssetGroupUtil.fetchIssuesInfo(COMP_API_URL, ag, domains,getToken()); docList.parallelStream().forEach(doc -> { doc.put("ag", ag); doc.put("date", CURR_DATE); doc.put("@id", Util.getUniqueID(ag + doc.get(DOMAIN) + CURR_DATE)); }); docs.addAll(docList); } catch (Exception e) { log.error("Exception in uploadAssetGroupIssues" , e); Map<String,String> errorMap = new HashMap<>(); errorMap.put(ERROR, "Exception in uploadAssetGroupIssues for Asset Group"+ag); errorMap.put(ERROR_TYPE, WARN); errorMap.put(EXCEPTION, e.getMessage()); synchronized(errorList){ errorList.add(errorMap); } } }); ESManager.uploadData(AG_STATS, "issues", docs, "@id", false); log.info(" End Collecing issues"); }  List<Map<String, String>> collectAssetGroupStats(); void uploadAssetGroupTagCompliance(List<String> assetGroups); void uploadAssetGroupRuleCompliance(Map<String, List<String>> assetGroups); void uploadAssetGroupCompliance(Map<String, List<String>> assetGroups); void uploadAssetGroupCountStats(List<String> assetGroups); void uploadAssetGroupIssues(Map<String, List<String>> assetGroups); void uploadAssetGroupVulnCompliance(List<String> assetGroups);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testUploadAssetGroupIssues() throws Exception{ PowerMockito.mockStatic(AssetGroupUtil.class); List<Map<String,Object>> returnList = new ArrayList<>(); Map<String,Object> issuesInfo = new HashMap<>(); issuesInfo.put("domain", "infra"); issuesInfo.put("total", 123l); returnList.add(issuesInfo); when(AssetGroupUtil.fetchIssuesInfo(anyString(),anyString(),anyList(),anyString())).thenReturn(returnList); PowerMockito.mockStatic(ESManager.class); doNothing().when(ESManager.class); ESManager.uploadData(anyString(), anyString(), anyList(), anyString(), anyBoolean()); Map<String, List<String>> assetGroups = new HashMap<>(); List<String> domains = new ArrayList<>(); domains.add("infra"); assetGroups.put("pacman", domains); assetGroupStatsCollector.uploadAssetGroupIssues(assetGroups); }