private ShareGroupHeartbeatResponseData.Assignment createAssignment(boolean mockMetadata) {
        Uuid topic1 = Uuid.randomUuid();
        Uuid topic2 = Uuid.randomUuid();
        if (mockMetadata) {
            Map<Uuid, String> topicNames = new HashMap<>();
            topicNames.put(topic1, "topic1");
            topicNames.put(topic2, "topic2");
            when(metadata.topicNames()).thenReturn(topicNames);
        }
        return new ShareGroupHeartbeatResponseData.Assignment()
                .setTopicPartitions(Arrays.asList(
                        new ShareGroupHeartbeatResponseData.TopicPartitions()
                                .setTopicId(topic1)
                                .setPartitions(Arrays.asList(0, 1, 2)),
                        new ShareGroupHeartbeatResponseData.TopicPartitions()
                                .setTopicId(topic2)
                                .setPartitions(Arrays.asList(3, 4, 5))
                ));
    }
Member that intentionally leaves the group (via unsubscribe) should release assignment,
reset epoch to -1, keep member ID, and transition to {@link MemberState#LEAVING} to send out a
heartbeat with the leave epoch. Once the heartbeat request is sent out, the member should
transition to {@link MemberState#UNSUBSCRIBED}
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ShareMembershipManagerTest.java