public <N, T> void setValue(TKey<N, T> key, List<QualifiedValue<T>> values) {
        List<QualifiedValue<?>> oldValues = fields.get(key);
        if (oldValues != null) {
            throw new IllegalArgumentException(
                    "setValue should only be called be called once per tkey");
        }
        if (nextOrderIndex != null) {
            throw new IllegalArgumentException(
                    "setValue should not be called after addValue");
        }
        List<QualifiedValue<?>> sortedValues = new ArrayList<QualifiedValue<?>>(values);
        Collections.sort(sortedValues);
        fields.put(key, sortedValues);
    }