def _do_get_latest_featuregroup_version(featuregroup_name,
    featurestore_metadata):
    """
    Utility method to get the latest version of a particular featuregroup

    Args:
        :featuregroup_name: the featuregroup to get the latest version of
        :featurestore_metadata: metadata of the featurestore

    Returns:
        the latest version of the featuregroup in the feature store
    """
    featuregroups = featurestore_metadata.featuregroups.values()
    matches = list(filter(lambda fg: fg.name == featuregroup_name,
        featuregroups))
    versions = list(map(lambda fg: int(fg.version), matches))
    if len(versions) > 0:
        return max(versions)
    else:
        return 0
