class VulnerabilityUtils {

    public static VulnerabilityUpdateStatus getUpdateStatusFromUpdateMap(Map<UpdateType, List<Vulnerability>> statusToVulnerabilities){
        VulnerabilityUpdateStatus status = getEmptyVulnerabilityUpdateStatus();
        status.requestStatus = nullToEmptyList(statusToVulnerabilities.get(UpdateType.FAILED)).size() > 0
                ? RequestStatus.FAILURE
                : RequestStatus.SUCCESS;

        for(UpdateType updateType: UpdateType.values()){
            List<String> idList = nullToEmptyList(statusToVulnerabilities.get(updateType))
                    .stream()
                    .map(Vulnerability::getExternalId)
                    .collect(Collectors.toList());
            status.statusToVulnerabilityIds.get(updateType).addAll(idList);
        }
        return status;
    }

}