VulnerabilityUtils { public static List<String> successIdsFromUpdateMap(Map<UpdateType, List<Vulnerability>> updateMap){ List<String> totalList = new ArrayList<>(); totalList.addAll(nullToEmptyList(updateMap.get(UpdateType.NEW)).stream().map(Vulnerability::getId).collect(Collectors.toList())); totalList.addAll(nullToEmptyList(updateMap.get(UpdateType.UPDATED)).stream().map(Vulnerability::getId).collect(Collectors.toList())); totalList.addAll(nullToEmptyList(updateMap.get(UpdateType.OLD)).stream().map(Vulnerability::getId).collect(Collectors.toList())); return totalList; }  static VulnerabilityUpdateStatus getEmptyVulnerabilityUpdateStatus(RequestStatus requestStatus); static VulnerabilityUpdateStatus getEmptyVulnerabilityUpdateStatus(); static VulnerabilityUpdateStatus reduceVulnerabilityUpdateStatus(VulnerabilityUpdateStatus ... statuses); static VulnerabilityUpdateStatus getUpdateStatusFromUpdateMap(Map<UpdateType, List<Vulnerability>> statusToVulnerabilities); static List<String> successIdsFromUpdateMap(Map<UpdateType, List<Vulnerability>> updateMap);  }
@Test public void testSuccessIdsFromUpdateMapSuccess() throws Exception { assertThat(successIdsFromUpdateMap(updateMap), containsInAnyOrder("u1", "u2", "u3", "n1", "n2")); }
@Test public void testSuccessIdsFromUpdateMapFailure() throws Exception { assertThat(successIdsFromUpdateMap(failedUpdateMap), containsInAnyOrder("u1", "u2", "u3", "n1", "n2", "o1", "o2", "o3")); }