public static HitCounts createHitCounts(Query query, Result result) {
        com.yahoo.container.handler.Coverage coverage = result.getCoverage(false);

        return (coverage != null)
                ? new HitCounts(result.getHitCount(), result.getConcreteHitCount(), result.getTotalHitCount(),
                                query.getHits(), query.getOffset(), coverage.toLoggingCoverage())
                : new HitCounts(result.getHitCount(), result.getConcreteHitCount(), result.getTotalHitCount(),
                                 query.getHits(), query.getOffset(), null);
    }
Some leftover static methods.

@author Steinar Knutsen
container-search/src/main/java/com/yahoo/search/handler/SearchResponse.java