@SuppressWarnings("unchecked")
    @Override
    public Map<Integer, Object> validate(Object item) {
        try {
            NavigableMap<Integer, Object> objects = (NavigableMap<Integer, Object>) item;
            for (Map.Entry<Integer, Object> entry : objects.entrySet()) {
                Integer tag = entry.getKey();
                Field field = fields.get(tag);
                if (field == null) {
                    if (!(entry.getValue() instanceof RawTaggedField)) {
                        throw new SchemaException("The value associated with tag " + tag +
                            " must be a RawTaggedField in this version of the software.");
                    }
                } else {
                    field.type.validate(entry.getValue());
                }
            }
            return objects;
        } catch (ClassCastException e) {
            throw new SchemaException("Not a NavigableMap. Found class " + item.getClass().getSimpleName());
        }
    }
Create a new TaggedFields object with the given tags and fields.

@param fields    This is an array containing Integer tags followed
                 by associated Field objects.
@return          The new {@link TaggedFields}
clients/src/main/java/org/apache/kafka/common/protocol/types/TaggedFields.java