@Test public void testIndexOf() { final LocaleListCompat empty = LocaleListCompat.create(); assertEquals(-1, empty.indexOf(Locale.US)); final LocaleListCompat oneMember = LocaleListCompat.create(Locale.US); assertEquals(0, oneMember.indexOf(Locale.US)); assertEquals(-1, oneMember.indexOf(Locale.ENGLISH)); final LocaleListCompat twoMember = LocaleListCompat.forLanguageTags("en,fr"); assertEquals(0, twoMember.indexOf(forLanguageTag("en"))); assertEquals(1, twoMember.indexOf(forLanguageTag("fr"))); assertEquals(-1, twoMember.indexOf(forLanguageTag("en-US"))); }
@IntRange(from = -1) public int indexOf(Locale locale) { return IMPL.indexOf(locale); }
LocaleListCompat { @IntRange(from = -1) public int indexOf(Locale locale) { return IMPL.indexOf(locale); } }
LocaleListCompat { @IntRange(from = -1) public int indexOf(Locale locale) { return IMPL.indexOf(locale); } private  LocaleListCompat(); }
LocaleListCompat { @IntRange(from = -1) public int indexOf(Locale locale) { return IMPL.indexOf(locale); } private  LocaleListCompat(); @RequiresApi(24) static LocaleListCompat wrap(Object object); @Nullable Object unwrap(); static LocaleListCompat create(@NonNull Locale... localeList); Locale get(int index); boolean isEmpty(); @IntRange(from = 0) int size(); @IntRange(from = -1) int indexOf(Locale locale); @NonNull String toLanguageTags(); Locale getFirstMatch(String[] supportedLocales); @NonNull static LocaleListCompat getEmptyLocaleList(); @NonNull static LocaleListCompat forLanguageTags(@Nullable String list); @NonNull @Size(min = 1) static LocaleListCompat getAdjustedDefault(); @NonNull @Size(min = 1) static LocaleListCompat getDefault(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); }
LocaleListCompat { @IntRange(from = -1) public int indexOf(Locale locale) { return IMPL.indexOf(locale); } private  LocaleListCompat(); @RequiresApi(24) static LocaleListCompat wrap(Object object); @Nullable Object unwrap(); static LocaleListCompat create(@NonNull Locale... localeList); Locale get(int index); boolean isEmpty(); @IntRange(from = 0) int size(); @IntRange(from = -1) int indexOf(Locale locale); @NonNull String toLanguageTags(); Locale getFirstMatch(String[] supportedLocales); @NonNull static LocaleListCompat getEmptyLocaleList(); @NonNull static LocaleListCompat forLanguageTags(@Nullable String list); @NonNull @Size(min = 1) static LocaleListCompat getAdjustedDefault(); @NonNull @Size(min = 1) static LocaleListCompat getDefault(); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString();  }