MediaIDHelper { public static String createMediaID(String musicID, String... categories) { StringBuilder sb = new StringBuilder(); if (categories != null) { for (int i=0; i < categories.length; i++) { if (!isValidCategory(categories[i])) { throw new IllegalArgumentException("Invalid category: " + categories[0]); } sb.append(categories[i]); if (i < categories.length - 1) { sb.append(CATEGORY_SEPARATOR); } } } if (musicID != null) { sb.append(LEAF_SEPARATOR).append(musicID); } return sb.toString(); }  static String createMediaID(String musicID, String... categories); static String extractMusicIDFromMediaID(@NonNull String mediaID); static @NonNull String[] getHierarchy(@NonNull String mediaID); static String extractBrowseCategoryValueFromMediaID(@NonNull String mediaID); static boolean isBrowseable(@NonNull String mediaID); static String getParentMediaID(@NonNull String mediaID); static boolean isMediaItemPlaying(Context context,
                                             MediaBrowserCompat.MediaItem mediaItem); static final String MEDIA_ID_EMPTY_ROOT; static final String MEDIA_ID_ROOT; static final String MEDIA_ID_MUSICS_BY_GENRE; static final String MEDIA_ID_MUSICS_BY_SEARCH; }
@Test(expected = IllegalArgumentException.class) public void testInvalidSymbolsInMediaIDStructure() throws Exception { fail(MediaIDHelper.createMediaID(null, "BY|GENRE/2", "Classic 70's")); }