@Override
    public <N, T> QualifiedValue<T> addValue(TKey<N, T> key, T value, Enum<?>... qualifiers) {
        if (value == null) {
            throw new IllegalArgumentException(
                    "Argument 'value' should not be null!");
        }

        Set<Enum<?>> quals = new LinkedHashSet<>();
        for (Enum<?> qualifier : qualifiers) {
            if (qualifier != null) {
                quals.add(qualifier);
            }
        }

        List<QualifiedValue<?>> values = fields.get(key);
        if (values == null) {
            values = new ArrayList<>();
            fields.put(key, values);
        }
        if (nextOrderIndex == null) {
            nextOrderIndex = calculateNextOrderIndex();
        }
        QualifiedValue<T> qualifiedValue = new QualifiedValue<>(
                value, quals, nextOrderIndex++);
        values.add(qualifiedValue);
        return qualifiedValue;
    }