public boolean hasMetadataExpired(long currentTimeMs) {
        return currentTimeMs >= metadataRefreshDeadline.deadlineMs || groupEpoch() < metadataRefreshDeadline.epoch;
    }
Checks if a metadata refresh is required. A refresh is required in two cases:
1) The deadline is smaller or equal to the current time;
2) The group epoch associated with the deadline is larger than
   the current group epoch. This means that the operations which updated
   the deadline failed.

@param currentTimeMs The current time in milliseconds.
@return A boolean indicating whether a refresh is required or not.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/modern/ModernGroup.java