### Question:
Timepoint implements Parcelable, Comparable<Timepoint> { public void add(TYPE type, int value) { if (type == MINUTE) value *= 60; if (type == HOUR) value *= 3600; value += toSeconds(); switch (type) { case SECOND: second = (value % 3600) % 60; case MINUTE: minute = (value % 3600) / 60; case HOUR: hour = (value / 3600) % 24; } } Timepoint(Timepoint time);  Timepoint(@IntRange(from=0, to=23) int hour,
                     @IntRange(from=0, to=59) int minute,
                     @IntRange(from=0, to=59) int second);  Timepoint(@IntRange(from=0, to=23) int hour,
                     @IntRange(from=0, to=59) int minute);  Timepoint(@IntRange(from=0, to=23) int hour);  Timepoint(Parcel in); @IntRange(from=0, to=23) int getHour(); @IntRange(from=0, to=59) int getMinute(); @IntRange(from=0, to=59) int getSecond(); boolean isAM(); boolean isPM(); void setAM(); void setPM(); void add(TYPE type, int value); int get(@NonNull TYPE type); int toSeconds(); @Override int hashCode(); @Override boolean equals(Object o); boolean equals(@Nullable Timepoint time, @NonNull TYPE resolution); @Override int compareTo(@NonNull Timepoint t); @Override void writeToParcel(Parcel out, int flags); @Override int describeContents(); @Override String toString(); static final Parcelable.Creator<Timepoint> CREATOR; }### Answer:
@Test public void timepointsWithSameFieldsShouldBeDistinctInHashSet() { HashSet<Timepoint> timepoints = new HashSet<>(4); timepoints.add(new Timepoint(12, 0, 0)); timepoints.add(new Timepoint(12, 0, 0)); timepoints.add(new Timepoint(12, 0, 0)); timepoints.add(new Timepoint(12, 0, 0)); Assert.assertEquals(timepoints.size(), 1); }
@Test public void timepointsWithDifferentFieldsShouldNotBeDistinctInHashSet() { HashSet<Timepoint> timepoints = new HashSet<>(4); timepoints.add(new Timepoint(12, 1, 0)); timepoints.add(new Timepoint(12, 2, 0)); timepoints.add(new Timepoint(12, 3, 0)); timepoints.add(new Timepoint(12, 4, 0)); Assert.assertEquals(timepoints.size(), 4); }