class VulnerabilityUtils {

    public static VulnerabilityUpdateStatus reduceVulnerabilityUpdateStatus(VulnerabilityUpdateStatus ... statuses){
        VulnerabilityUpdateStatus resultStatus = getEmptyVulnerabilityUpdateStatus();

        RequestStatus requestStatus = Arrays.stream(statuses)
                .map(VulnerabilityUpdateStatus::getRequestStatus)
                .reduce(RequestStatus.SUCCESS, CommonUtils::reduceRequestStatus);
        resultStatus.setRequestStatus(requestStatus);

        for(UpdateType updateType : UpdateType.values()) {
            for (VulnerabilityUpdateStatus status : statuses) {
                if(status.isSetStatusToVulnerabilityIds()) {
                    resultStatus.statusToVulnerabilityIds.get(updateType)
                            .addAll(nullToEmptyList(status.statusToVulnerabilityIds.get(updateType)));
                }
            }
        }
        return resultStatus;
    }

}