class SecHubResultMerger {

    public SecHubResult merge(SecHubResult result1, SecHubResult result2) {
        if (result1==null) {
            return result2;
        }
        if (result2==null) {
            return result1;
        }
        
        SecHubResult merged = new SecHubResult();
        mergeFindings(result1, merged);
        mergeFindings(result2, merged);

        mergeFalsePositives(result1, merged);
        mergeFalsePositives(result2, merged);
        
        merged.setCount(result1.getCount()+result2.getCount());
        
        return merged;
    }

}