for (Entry<String, FieldStatsInfo> entry : fieldStatsInfo.entrySet()) {
FieldStatsInfo value = entry.getValue();
if (value == null) {
result.put(entry.getKey(), new SimpleFieldStatsResult());
continue;
}
SimpleFieldStatsResult statsResult = populateStatsResultWithFieldStatsInfo(new SimpleFieldStatsResult(), value);
statsResult.setCountDistinct(value.getCountDistinct());
statsResult.setDistinctValues(value.getDistinctValues());
Map<String, List<FieldStatsInfo>> facets = value.getFacets();
if (facets != null) {
statsResult.setStatsResults(convertFieldStatsInfoToStatsResultMap(facets));
}
result.put(entry.getKey(), statsResult);
}