void populateContainedMediaList(UUID jobId, TokensAndUrlAuthData authData)
          throws IOException, InvalidTokenException, PermissionDeniedException, UploadErrorException, FailedToListAlbumsException, FailedToListMediaItemsException {
    // This method is only called once at the beginning of the transfer, so we can start by
    // initializing a new TempMediaData to be store in the job store.
    TempMediaData tempMediaData = new TempMediaData(jobId);

    String albumToken = null;
    AlbumListResponse albumListResponse;
    MediaItemSearchResponse containedMediaSearchResponse;
    do {
      albumListResponse = listAlbums(jobId, authData, Optional.ofNullable(albumToken));
      albumToken = albumListResponse.getNextPageToken();
      if (albumListResponse.getAlbums() == null) {
        continue;
      }

      for (GoogleAlbum album : albumListResponse.getAlbums()) {
        String albumId = album.getId();
        String photoToken = null;

        do {
          containedMediaSearchResponse = listMediaItems(jobId, authData, Optional.of(albumId), Optional.ofNullable(photoToken));
          if (containedMediaSearchResponse.getMediaItems() != null) {
            for (GoogleMediaItem mediaItem : containedMediaSearchResponse.getMediaItems()) {
              tempMediaData.addContainedPhotoId(mediaItem.getId());
            }
          }
          photoToken = containedMediaSearchResponse.getNextPageToken();
        } while (photoToken != null);
      }

      albumToken = albumListResponse.getNextPageToken();
    } while (albumToken != null);

    // TODO: if we see complaints about objects being too large for JobStore in other places, we
    // should consider putting logic in JobStore itself to handle it
    InputStream stream = convertJsonToInputStream(tempMediaData);
    jobStore.create(jobId, createCacheKey(), stream);
  }
Method for storing a list of all photos that are already contained in albums
extensions/data-transfer/portability-data-transfer-google/src/main/java/org/datatransferproject/datatransfer/google/media/GoogleMediaExporter.java