test_class.file: gazeplay-core/src/test/java/net/gazeplay/gameslocator/GameSpecSourceInstantiatorTest.java
test_class.identifier: GameSpecSourceInstantiatorTest
test_case.body: @Test
      void shouldInstantiateFromListOfSources() throws ClassNotFoundException {
          List<Class> classList = new ArrayList<>(List.of(
              Class.forName("net.gazeplay.games.videogrid.VideoGridGameSpecSource"),
              Class.forName("net.gazeplay.games.order.OrderGameSpecSource"),
              Class.forName("net.gazeplay.games.mediaPlayer.MediaPlayerGameSpecSource")
          ));
  
          GameSpecSourceInstantiator instantiator = new GameSpecSourceInstantiator();
          List<GameSpecSource> result = instantiator.instantiateGameSpecSources(classList);
  
          assertEquals(3, result.size());
      }
test_case.class_method_signature: GameSpecSourceInstantiatorTest.shouldInstantiateFromListOfSources()
test_case.full_signature: @Test void shouldInstantiateFromListOfSources()
test_case.identifier: shouldInstantiateFromListOfSources
test_case.invocations: of forName forName forName instantiateGameSpecSources assertEquals size
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldInstantiateFromListOfSources()
focal_class.file: gazeplay-core/src/main/java/net/gazeplay/gameslocator/GameSpecSourceInstantiator.java
focal_class.identifier: GameSpecSourceInstantiator
focal_class.class_method_signature: GameSpecSourceInstantiator.instantiateGameSpecSources(List<Class> gamesClasses)
focal_class.full_signature: public List<GameSpecSource> instantiateGameSpecSources(List<Class> gamesClasses)
focal_class.identifier: instantiateGameSpecSources
focal_class.modifiers: public
focal_class.parameters: (List<Class> gamesClasses)
focal_class.return: List<GameSpecSource>
focal_class.signature: List<GameSpecSource> instantiateGameSpecSources(List<Class> gamesClasses)
focal_method.body: public List<GameSpecSource> instantiateGameSpecSources(List<Class> gamesClasses) {
          return gamesClasses
              .stream()
              .map(gameClass -> {
                  try {
                      Constructor<GameSpecSource> defaultConstructor = gameClass.getConstructor();
                      return defaultConstructor.newInstance();
                  } catch (
                      NoSuchMethodException |
                          IllegalAccessException |
                          InstantiationException |
                          InvocationTargetException |
                          ClassCastException e) {
                      throw new GameSpecInstantiationException("Failed to create new instance of class " + gameClass, e);
                  }
              })
              .collect(Collectors.toList());
      }
focal_method.class_method_signature: GameSpecSourceInstantiator.instantiateGameSpecSources(List<Class> gamesClasses)
focal_method.full_signature: public List<GameSpecSource> instantiateGameSpecSources(List<Class> gamesClasses)
focal_method.identifier: instantiateGameSpecSources
focal_method.invocations: collect map stream getConstructor newInstance toList
focal_method.modifiers: public
focal_method.parameters: (List<Class> gamesClasses)
focal_method.return: List<GameSpecSource>
focal_method.signature: List<GameSpecSource> instantiateGameSpecSources(List<Class> gamesClasses)