public static String partitionsToLogString(Collection<TopicIdPartition> partitions, Boolean traceEnabled) {
        if (traceEnabled) {
            return String.format("( %s )", String.join(", ", partitions.toString()));
        }
        return String.format("%s partition(s)", partitions.size());
    }
@Test
    public void testPartitionsToLogString() {
        Uuid uuid1 = Uuid.randomUuid();
        Uuid uuid2 = Uuid.randomUuid();
        List<TopicIdPartition> partitions = Arrays.asList(
            new TopicIdPartition(uuid1, 0, "foo"),
            new TopicIdPartition(uuid2, 1, "bar"));

        String response = ShareSession.partitionsToLogString(partitions, false);
        assertEquals("2 partition(s)", response);

        response = ShareSession.partitionsToLogString(partitions, true);
        assertEquals(String.format("( [%s:foo-0, %s:bar-1] )", uuid1, uuid2), response);
    }