private static Set<TopicPartition> toSet(TopicPartition... arr) {
        TreeSet<TopicPartition> set = new TreeSet<>(Comparator.comparing(TopicPartition::toString));
        set.addAll(Arrays.asList(arr));
        return set;
    }
Create a set of TopicPartitions.  We use a TreeSet, in order to get a deterministic
ordering for test purposes.
clients/src/test/java/org/apache/kafka/clients/FetchSessionHandlerTest.java