SubtitleTools { public static void addMovieSubtitle(Movie movie, String subtitle) { String newSubtitles = addMovieSubtitle(movie.getSubtitles(), subtitle); movie.setSubtitles(newSubtitles); } private  SubtitleTools(); static void setMovieSubtitles(Movie movie, Collection<String> subtitles); static void addMovieSubtitle(Movie movie, String subtitle); static String addMovieSubtitle(final String actualSubtitles, final String newSubtitle); static List<String> getSubtitles(Movie movie);  }
@Test public void testAddMovieSubtitles1() { LOG.info("AddMovieSubtitles1"); String actualSubtitles = Movie.UNKNOWN; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "eng"); assertEquals("English", newSubtitles); }
@Test public void testAddMovieSubtitles2() { LOG.info("AddMovieSubtitles2"); String actualSubtitles = "NO"; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "eng"); assertEquals("English", newSubtitles); }
@Test public void testAddMovieSubtitles3() { LOG.info("AddMovieSubtitles3"); String newSubtitles = SubtitleTools.addMovieSubtitle("YES", "eng"); newSubtitles = SubtitleTools.addMovieSubtitle(newSubtitles, "de"); assertEquals("English / German", newSubtitles); }
@Test public void testAddMovieSubtitles4() { LOG.info("AddMovieSubtitles4"); String actualSubtitles = "YES"; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "NO"); assertEquals("NO", newSubtitles); }
@Test public void testAddMovieSubtitles5() { LOG.info("AddMovieSubtitles5"); String actualSubtitles = "NO"; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "YES"); assertEquals("YES", newSubtitles); }
@Test public void testAddMovieSubtitles6() { LOG.info("AddMovieSubtitles6"); String actualSubtitles = "English / German"; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "YES"); assertEquals("English / German", newSubtitles); }
@Test public void testAddMovieSubtitles7() { LOG.info("AddMovieSubtitles7"); String actualSubtitles = "English / German"; String newSubtitles = SubtitleTools.addMovieSubtitle(actualSubtitles, "German"); assertEquals("English / German", newSubtitles); }
@Test public void testAddMovieSubtitles8() { LOG.info("AddMovieSubtitles8"); String subs = SubtitleTools.addMovieSubtitle("", "en"); subs = SubtitleTools.addMovieSubtitle(subs, "german"); subs = SubtitleTools.addMovieSubtitle(subs, "de"); assertEquals("English / German", subs); }