1. Zk data format standardization for admin/reassign_partitions and admin/preffered_replica_election. (These changes still hit the bug mentioned in
KAFKA-780 which occurred without the changes in this patch.)
2. I changed Json manipulation related functions in Utils, because mergeJsonObjects had a bug which could screw up a JSON string that included a nested object or an array, while attempting to sort the fields in the string. I replaced it with a new function mergeJsonFields and created a new function mapToJsonFields. As it turned out, these two functions also helped reduce some lines of code in other JSON related functions in Utils.
3. Ran optimize imports on the entire source code. Three files unrelated to this patch have been touched.
Testing done -
i. Unit tests pass
ii. Verified the format of all Zk data structures as mentioned in the wiki to ensure 2 above didn't break anything. Verified that the fields are sorted.
iii. Tested reassign-partitions tool and preferred-replica-election admin tools, but they hit the exception mentioned in