### Question:
LocationRequest implements Parcelable { public LocationRequest setPriority(int priority) { if (priority != PRIORITY_HIGH_ACCURACY && priority != PRIORITY_BALANCED_POWER_ACCURACY && priority != PRIORITY_LOW_POWER && priority != PRIORITY_NO_POWER) { throw new IllegalArgumentException("Invalid priority: " + priority); } this.priority = priority; return this; } private  LocationRequest(); private  LocationRequest(PidReader reader);  LocationRequest(LocationRequest incoming); protected  LocationRequest(Parcel in); static LocationRequest create(); static LocationRequest create(PidReader reader); long getInterval(); LocationRequest setInterval(long millis); long getFastestInterval(); LocationRequest setFastestInterval(long millis); float getSmallestDisplacement(); LocationRequest setSmallestDisplacement(float meters); int getPriority(); LocationRequest setPriority(int priority); @Override boolean equals(Object o); @Override int hashCode(); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); static final int PRIORITY_HIGH_ACCURACY; static final int PRIORITY_BALANCED_POWER_ACCURACY; static final int PRIORITY_LOW_POWER; static final int PRIORITY_NO_POWER; static final Parcelable.Creator<LocationRequest> CREATOR; }### Answer:
@Test(expected = IllegalArgumentException.class) public void setPriority_shouldRejectInvalidValues() throws Exception { locationRequest.setPriority(-1); }