@Test public void addThreeTest() { videos.add("name", "chapter1", "chapter2", 80); assertEquals(1, videos.list.size()); }
public Video add(String mediaLabel, int duration) { int index = searchVideoIndexByMediaLabel(mediaLabel); Video video; if (index == -1) { video = new Video(player) .setMediaLabel(mediaLabel) .setDuration(duration); list.add(video); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This Video already exists"); video = list.get(index); } return video; }
Videos { public Video add(String mediaLabel, int duration) { int index = searchVideoIndexByMediaLabel(mediaLabel); Video video; if (index == -1) { video = new Video(player) .setMediaLabel(mediaLabel) .setDuration(duration); list.add(video); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This Video already exists"); video = list.get(index); } return video; } }
Videos { public Video add(String mediaLabel, int duration) { int index = searchVideoIndexByMediaLabel(mediaLabel); Video video; if (index == -1) { video = new Video(player) .setMediaLabel(mediaLabel) .setDuration(duration); list.add(video); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This Video already exists"); video = list.get(index); } return video; } Videos(MediaPlayer player); }
Videos { public Video add(String mediaLabel, int duration) { int index = searchVideoIndexByMediaLabel(mediaLabel); Video video; if (index == -1) { video = new Video(player) .setMediaLabel(mediaLabel) .setDuration(duration); list.add(video); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This Video already exists"); video = list.get(index); } return video; } Videos(MediaPlayer player); Video add(String mediaLabel, int duration); Video add(String mediaLabel, String mediaTheme1, int duration); Video add(String mediaLabel, String mediaTheme1, String mediaTheme2, int duration); Video add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaTheme3, int duration); void remove(String mediaLabel); void removeAll(); }
Videos { public Video add(String mediaLabel, int duration) { int index = searchVideoIndexByMediaLabel(mediaLabel); Video video; if (index == -1) { video = new Video(player) .setMediaLabel(mediaLabel) .setDuration(duration); list.add(video); } else { Tool.executeCallback(player.getTracker().getListener(), Tool.CallbackType.WARNING, "This Video already exists"); video = list.get(index); } return video; } Videos(MediaPlayer player); Video add(String mediaLabel, int duration); Video add(String mediaLabel, String mediaTheme1, int duration); Video add(String mediaLabel, String mediaTheme1, String mediaTheme2, int duration); Video add(String mediaLabel, String mediaTheme1, String mediaTheme2, String mediaTheme3, int duration); void remove(String mediaLabel); void removeAll();  }