public ControlledShutdownResponse(Struct struct) { super(struct); errorCode = struct.getShort(ERROR_CODE_KEY_NAME); Set<TopicPartition> partitions = new HashSet<>(); for (Object topicPartitionObj : struct.getArray(PARTITIONS_REMAINING_KEY_NAME)) { Struct topicPartition = (Struct) topicPartitionObj; String topic = topicPartition.getString(TOPIC_KEY_NAME); int partition = topicPartition.getInt(PARTITION_KEY_NAME); partitions.add(new TopicPartition(topic, partition)); } partitionsRemaining = partitions; }