Map<K, Integer> getPrimitiveMap() {
        Map<K, Integer> retVal = new LinkedHashMap<>();
        for (Entry<K, IntegerFieldValue> entry : map.entrySet()) {
            retVal.put(entry.getKey(), entry.getValue().getInteger());
        }
        return retVal;
    }
Reserve space for this amount of keys in order to avoid resizing
document/src/main/java/com/yahoo/document/datatypes/WeightedSet.java