private MembershipManagerImpl memberJoinWithAssignment() {
        Uuid topicId = Uuid.randomUuid();
        MembershipManagerImpl membershipManager = mockJoinAndReceiveAssignment(true);
        membershipManager.onHeartbeatRequestGenerated();
        when(metadata.topicNames()).thenReturn(Collections.singletonMap(topicId, "topic"));
        receiveAssignment(topicId, Collections.singletonList(0), membershipManager);
        membershipManager.onHeartbeatRequestGenerated();
        assertFalse(membershipManager.currentAssignment().isNone());
        return membershipManager;
    }
Create heartbeat response with the given assignment and a bumped epoch (incrementing by 1
as default but could be any increment). This will be used to mock when a member
receives a heartbeat response to the join request, and the response includes an assignment.
clients/src/test/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImplTest.java