private static Set<TopicIdPartition> partitions(TopicIdPartition... partitions) {
        return new HashSet<>(Arrays.asList(partitions));
    }
This is a handy utility method for returning a set from a varargs array.
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ShareFetchBufferTest.java