public static TaggedFields of(Object... fields) {
        if (fields.length % 2 != 0) {
            throw new RuntimeException("TaggedFields#of takes an even " +
                "number of parameters.");
        }
        TreeMap<Integer, Field> newFields = new TreeMap<>();
        for (int i = 0; i < fields.length; i += 2) {
            Integer tag = (Integer) fields[i];
            Field field = (Field) fields[i + 1];
            newFields.put(tag, field);
        }
        return new TaggedFields(newFields);
    }
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