### Question:
User implements Parcelable { public void addRating(float rate) { float newRating; newRating = ((this.rating*this.numRatings)+rate)/(numRatings+1); this.rating = newRating; this.numRatings++; } User(String username, String email, String phoneNumber);  User(String username, String email, String phoneNumber, float rating);  User(String Username); private  User(Parcel in); String getUsername(); void setUsername(String name); String getEmail(); void setEmail(String mail); void setPhoneNumber(String number); String getPhoneNumber(); void setId(String id); String getId(); float getRating(); void addRating(float rate); void addReview(String newReview); ArrayList<String> getReviews(); @Override int describeContents(); @Override void writeToParcel(Parcel out, int flags); static final Parcelable.Creator<User> CREATOR; }### Answer:
@Test public void addRating() throws Exception { User newUser = new User("HelloWorld"); newUser.addRating(4); assertTrue(newUser.getRating() == 4.0); newUser.addRating(3.0f); assertTrue(newUser.getRating() == 3.5); }