private DefaultErrorHit merge(DefaultErrorHit first, DefaultErrorHit second) {
        if (first == null) return second;
        if (second == null) return first;

        String mergedSource = first.getSource()!=null ? first.getSource() : second.getSource();
        List<ErrorMessage> mergedErrors = new ArrayList<>();
        mergedErrors.addAll(first.errors());
        mergedErrors.addAll(second.errors());
        return new DefaultErrorHit(mergedSource, mergedErrors);
    }
Combines two error hits to one. Any one argument may be null, in which case the other is returned.

@return Merged errors
container-search/src/main/java/com/yahoo/search/result/HitGroup.java