CalendarUnit { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof CalendarUnit)) return false; CalendarUnit that = (CalendarUnit) o; if (mSelected != that.mSelected) return false; if (!mFrom.equals(that.mFrom)) return false; if (!mTo.equals(that.mTo)) return false; if (!mToday.equals(that.mToday)) return false; return true; } protected  CalendarUnit(@NonNull LocalDate from, @NonNull LocalDate to, @NonNull LocalDate today); LocalDate getToday(); LocalDate getFrom(); LocalDate getTo(); boolean isSelected(); abstract boolean hasNext(); abstract boolean hasPrev(); abstract boolean next(); abstract boolean prev(); @CalendarType abstract int getType(); boolean isIn(@NonNull LocalDate date); boolean isInView(@NonNull LocalDate date); abstract void deselect(@NonNull LocalDate date); abstract boolean select(@NonNull LocalDate date); abstract void build(); @Override boolean equals(Object o); @Override int hashCode(); static final int TYPE_WEEK; static final int TYPE_MONTH; }
@Test public void testEqualsNull() throws Exception { assertFalse(mUnit.equals(null)); }
@Test public void testEqualsSelf() throws Exception { assertTrue(mUnit.equals(mUnit)); }