### Question:
TvContractUtils { public static String contentRatingsToString(TvContentRating[] contentRatings) { if (contentRatings == null || contentRatings.length == 0) { return null; } StringBuilder ratings = new StringBuilder(contentRatings[0].flattenToString()); for (int i = 1; i < contentRatings.length; ++i) { ratings.append(DELIMITER); ratings.append(contentRatings[i].flattenToString()); } return ratings.toString(); } private  TvContractUtils(); static TvContentRating[] stringToContentRatings(String commaSeparatedRatings); static String contentRatingsToString(TvContentRating[] contentRatings); static String[] stringToAudioLanguages(String commaSeparatedString); static String audioLanguagesToString(String[] audioLanguages);  }### Answer:
@Test public void testContentRatingsToString_nullInput() { assertEquals(null, TvContractUtils.contentRatingsToString(null)); }
@Test public void testContentRatingsToString_emptyInput() { assertEquals(null, TvContractUtils.contentRatingsToString(new TvContentRating[0])); }
@Test public void testContentRatingsToString_singleRating() { TvContentRating[] ratings = new TvContentRating[1]; ratings[0] = TvContentRating.createRating( "com.android.tv", "US_TV", "US_TV_PG", "US_TV_D", "US_TV_L", "US_TV_S", "US_TV_V"); assertEquals("com.android.tv/US_TV/US_TV_PG/US_TV_D/US_TV_L/US_TV_S/US_TV_V", TvContractUtils.contentRatingsToString(ratings)); }
@Test public void testContentRatingsToString_multipleRatings() { TvContentRating[] ratings = new TvContentRating[3]; ratings[0] = TvContentRating.createRating( "com.android.tv", "US_MV", "US_MV_NC17"); ratings[1] = TvContentRating.createRating( "com.android.tv", "US_TV", "US_TV_PG", "US_TV_D", "US_TV_L", "US_TV_S", "US_TV_V"); ratings[2] = TvContentRating.createRating( "com.android.tv", "US_TV", "US_TV_Y7"); String ratingString = "com.android.tv/US_MV/US_MV_NC17," + "com.android.tv/US_TV/US_TV_PG/US_TV_D/US_TV_L/US_TV_S/US_TV_V," + "com.android.tv/US_TV/US_TV_Y7"; assertEquals(ratingString, TvContractUtils.contentRatingsToString(ratings)); }