public static Map<String,Episode> convertListToMap(List<Episode> episodeList){
  if (episodeList == null) {
    throw new IllegalArgumentException("Collectables in list cannot be null");
  }
  Map<String,Episode> collectableMap=new ArrayMap<>(episodeList.size());
  for (int i=0; i < episodeList.size(); i++) {
    Episode episode=episodeList.get(i);
    collectableMap.put(episode.getGeneratedId(),episode);
  }
  return collectableMap;
}

public static Map < String , Episode > convertListToMap ( List < Episode > episodeList ) { if ( episodeList == null ) { throw new IllegalArgumentException ( "Collectables in list cannot be null" ) ; } Map < String , Episode > collectableMap = new ArrayMap < > ( episodeList . size ( ) ) ; for ( int i = 0 ; i < episodeList . size ( ) ; i ++ ) { Episode episode = episodeList . get ( i ) ; collectableMap . put ( episode . getGeneratedId ( ) , episode ) ; } return collectableMap ; }
converts a list of collectables to a hashmap , using the server id as the key
