private Integer addInternal(Object token, int weight) {
        Integer newWeight = weight;
        Integer oldWeight = set.put(token, newWeight);
        if (oldWeight != null && oldWeight > newWeight) {
            set.put(token, oldWeight);
            return oldWeight;
        }
        return newWeight;
    }
Adds a weighted token.
If this token is already in the set, the maximum weight is kept.
The weight must be 1 or more; negative values (and zero) are not allowed.

@return the weight of the added token (might be the old value, if kept)
container-search/src/main/java/com/yahoo/prelude/query/WeightedSetItem.java