WikiSite implements Parcelable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } WikiSite wiki = (WikiSite) o; if (!uri.equals(wiki.uri)) { return false; } return languageCode.equals(wiki.languageCode); } WikiSite(@NonNull Uri uri);  WikiSite(@NonNull String url);  WikiSite(@NonNull String authority, @NonNull String languageCode); protected  WikiSite(@NonNull Parcel in); static boolean supportedAuthority(@NonNull String authority); static void setDefaultBaseUrl(@NonNull String url); static WikiSite forLanguageCode(@NonNull String languageCode); @NonNull String scheme(); @NonNull String authority(); @NonNull String mobileAuthority(); String mobileUrl(); @NonNull String desktopAuthority(); @NonNull String subdomain(); @NonNull String path(@NonNull String segment); @NonNull Uri uri(); @NonNull String url(); @NonNull String url(@NonNull String segment); @NonNull String languageCode(); PageTitle titleForInternalLink(String internalLink); PageTitle titleForUri(Uri uri); @NonNull String dbName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int describeContents(); @Override void writeToParcel(@NonNull Parcel dest, int flags); static final String DEFAULT_SCHEME; static final Parcelable.Creator<WikiSite> CREATOR; }
@Test public void testEquals() { assertThat(WikiSite.forLanguageCode("en"), is(WikiSite.forLanguageCode("en"))); assertThat(WikiSite.forLanguageCode("ta"), not(WikiSite.forLanguageCode("en"))); assertThat(WikiSite.forLanguageCode("ta").equals("ta.wikipedia.org"), is(false)); }