MangaLibraryUpdate implements Parcelable { public void setRating(@Nullable final Rating rating) { mRating = rating; } MangaLibraryUpdate(final MangaDigest digest);  MangaLibraryUpdate(final MangaLibraryEntry libraryEntry); private  MangaLibraryUpdate(final Parcel source); boolean containsModifications(); int getChaptersRead(); Defaults getDefaults(); String getMangaId(); String getMangaTitle(); @Nullable String getNotes(); @Nullable Rating getRating(); @Nullable ReadingStatus getReadingStatus(); int getReReadCount(); int getVolumesRead(); boolean isPrivate(); boolean isReReading(); void setChaptersRead(final int chaptersRead); void setNotes(@Nullable String notes); void setPrivacy(final Privacy privacy); void setRating(@Nullable final Rating rating); void setReadingStatus(@Nullable final ReadingStatus readingStatus); void setReReadCount(final int reReadCount); void setReReading(final boolean reReading); void setVolumesRead(final int volumesRead); JsonObject toJson(); @Override int describeContents(); @Override void writeToParcel(final Parcel dest, final int flags); static final Creator<MangaLibraryUpdate> CREATOR; }
@Test public void testSetRating() throws Exception { assertFalse(mLibraryUpdate.containsModifications()); mLibraryUpdate.setRating(mLibraryUpdate.getDefaults().getRating()); assertFalse(mLibraryUpdate.containsModifications()); mLibraryUpdate.setRating(Rating.FOUR); assertTrue(mLibraryUpdate.containsModifications()); mLibraryUpdate.setRating(mLibraryUpdate.getDefaults().getRating()); assertFalse(mLibraryUpdate.containsModifications()); mLibraryUpdate.setRating(Rating.THREE_POINT_FIVE); assertTrue(mLibraryUpdate.containsModifications()); }