DownloadRequest implements Parcelable { @Override public boolean equals(@Nullable Object o) { if (!(o instanceof DownloadRequest)) { return false; } DownloadRequest that = (DownloadRequest) o; return id.equals(that.id) && type.equals(that.type) && uri.equals(that.uri) && streamKeys.equals(that.streamKeys) && Util.areEqual(customCacheKey, that.customCacheKey) && Arrays.equals(data, that.data); } DownloadRequest(
      String id,
      String type,
      Uri uri,
      List<StreamKey> streamKeys,
      @Nullable String customCacheKey,
      @Nullable byte[] data);   DownloadRequest(Parcel in); DownloadRequest copyWithId(String id); DownloadRequest copyWithMergedRequest(DownloadRequest newRequest); @Override String toString(); @Override boolean equals(@Nullable Object o); @Override final int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final String TYPE_PROGRESSIVE; static final String TYPE_DASH; static final String TYPE_HLS; static final String TYPE_SS; final String id; final String type; final Uri uri; final List<StreamKey> streamKeys; @Nullable final String customCacheKey; final byte[] data; static final Parcelable.Creator<DownloadRequest> CREATOR; }
@SuppressWarnings("EqualsWithItself") @Test public void testEquals() { DownloadRequest request1 = createRequest(uri1); assertThat(request1.equals(request1)).isTrue(); DownloadRequest request2 = createRequest(uri1); DownloadRequest request3 = createRequest(uri1); assertEqual(request2, request3); DownloadRequest request4 = createRequest(uri1); DownloadRequest request5 = createRequest(uri1, new StreamKey(0, 0, 0)); assertNotEqual(request4, request5); DownloadRequest request6 = createRequest(uri1, new StreamKey(0, 1, 1)); DownloadRequest request7 = createRequest(uri1, new StreamKey(0, 0, 0)); assertNotEqual(request6, request7); DownloadRequest request8 = createRequest(uri1); DownloadRequest request9 = createRequest(uri2); assertNotEqual(request8, request9); DownloadRequest request10 = createRequest(uri1, new StreamKey(0, 0, 0), new StreamKey(0, 1, 1)); DownloadRequest request11 = createRequest(uri1, new StreamKey(0, 1, 1), new StreamKey(0, 0, 0)); assertEqual(request10, request11); DownloadRequest request12 = createRequest(uri1, new StreamKey(0, 0, 0)); DownloadRequest request13 = createRequest(uri1, new StreamKey(0, 1, 1), new StreamKey(0, 0, 0)); assertNotEqual(request12, request13); DownloadRequest request14 = createRequest(uri1); DownloadRequest request15 = createRequest(uri1); assertEqual(request14, request15); }