### Question:
YoutubeUserActivityCollector extends YoutubeDataCollector { List<Video> getVideoList(String videoId) throws IOException { VideoListResponse videosListResponse = this.youtube.videos().list("snippet,statistics") .setId(videoId) .setKey(config.getApiKey()) .execute(); if (videosListResponse.getItems().size() == 0) { LOGGER.debug("No Youtube videos found for videoId: {}", videoId); return new ArrayList<>(); } return videosListResponse.getItems(); } YoutubeUserActivityCollector(
      YouTube youtube,
      BlockingQueue<StreamsDatum> datumQueue,
      BackOffStrategy backOff,
      UserInfo userInfo,
      YoutubeConfiguration config); @Override void run();  }### Answer:
@Test public void testGetVideos() throws IOException { DateTime now = new DateTime(System.currentTimeMillis()); YouTube youtube = buildYouTube(0, 1, 0, now, now.minus(10000)); BlockingQueue<StreamsDatum> datumQueue = new ThroughputQueue<>(); YoutubeUserActivityCollector collector = new YoutubeUserActivityCollector(youtube, datumQueue, new ExponentialBackOffStrategy(2), new UserInfo().withUserId(USER_ID), this.config); List<Video> video = collector.getVideoList("fake_video_id"); assertNotNull(video.get(0)); }
@Test public void testGetVideosNull() throws IOException { DateTime now = new DateTime(System.currentTimeMillis()); YouTube youtube = buildYouTube(0, 0, 0, now.plus(10000), now.minus(10000)); BlockingQueue<StreamsDatum> datumQueue = new ThroughputQueue<>(); YoutubeUserActivityCollector collector = new YoutubeUserActivityCollector(youtube, datumQueue, new ExponentialBackOffStrategy(2), new UserInfo().withUserId(USER_ID), this.config); List<Video> video = collector.getVideoList("fake_video_id"); assertEquals(video.size(), 0); }