code: def test_study_system_attr_for_population_cache() -> None:
      sampler = multi_objective.samplers.NSGAIIMultiObjectiveSampler(
          population_size=10
      )
      study = multi_objective.create_study(
          ["minimize"], sampler=sampler
      )
  
      def get_cached_entries(
          study: multi_objective.study.MultiObjectiveStudy,
      ) -> List[Tuple[int, List[int]]]:
          study_system_attrs = study._storage.get_study_system_attrs(
              study._study_id
          )
          return [
              v
              for k, v in study_system_attrs.items()
              if k.startswith(
                  multi_objective.samplers._nsga2._POPULATION_CACHE_KEY_PREFIX
              )
          ]
  
      study.optimize(
          lambda t: [t.suggest_float("x", 0, 9)], n_trials=10
      )
      cached_entries = get_cached_entries(study)
      assert len(cached_entries) == 0
  
      study.optimize(lambda t: [t.suggest_float("x", 0, 9)], n_trials=1)
      cached_entries = get_cached_entries(study)
      assert len(cached_entries) == 1
      assert cached_entries[0][0] == 0  # Cached generation.
      assert len(cached_entries[0][1]) == 10  # Population size.
  
      study.optimize(
          lambda t: [t.suggest_float("x", 0, 9)], n_trials=10
      )
      cached_entries = get_cached_entries(study)
      assert len(cached_entries) == 1
      assert cached_entries[0][0] == 1  # Cached generation.
      assert len(cached_entries[0][1]) == 10
  
file_path: optuna/tests/multi_objective_tests/samplers_tests/test_nsga2.py
imports: from collections import Counter
  from typing import List
  from typing import Tuple
  from unittest.mock import patch
  import pytest
  import optuna
  from optuna import multi_objective
  from optuna.study._study_direction import StudyDirection
label_desc: Use image node_id 7 for calling a global function with example usage: test_study_system_attr_for_population_cache() and returns: unknown