code: private static int findPassIndexByName(
        List<PassFactory> factoryList, String name) {
      for (int i = 0; i < factoryList.size(); i++) {
        if (factoryList.get(i).getName().equals(name)) {
          return i;
        }
      }
  
      throw new IllegalArgumentException(
          "No factory named '" + name + "' in the factory list");
    }
docs: Throws an exception if no pass with the given name exists.