private Optional<ErrorHit> errorHitIn(List<Hit> hits) {
        return hits.stream().filter(h -> h instanceof ErrorHit).map(ErrorHit.class::cast).findFirst();
    }
Returns the (first) error hit in the given list, or empty if none
container-search/src/test/java/com/yahoo/search/result/test/HitGroupTestCase.java