@Test public void testEquals() { Year year1 = new Year(2002); Year year2 = new Year(2002); assertEquals(year1, year2); year1 = new Year(1999); assertFalse(year1.equals(year2)); year2 = new Year(1999); assertEquals(year1, year2); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Year)) { return false; } Year that = (Year) obj; return (this.year == that.year); }
Year extends RegularTimePeriod implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Year)) { return false; } Year that = (Year) obj; return (this.year == that.year); } }
Year extends RegularTimePeriod implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Year)) { return false; } Year that = (Year) obj; return (this.year == that.year); } Year();  Year(int year);  Year(Date time);  Year(Date time, TimeZone zone, Locale locale); }
Year extends RegularTimePeriod implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Year)) { return false; } Year that = (Year) obj; return (this.year == that.year); } Year();  Year(int year);  Year(Date time);  Year(Date time, TimeZone zone, Locale locale); int getYear(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); static Year parseYear(String s); }
Year extends RegularTimePeriod implements Serializable { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Year)) { return false; } Year that = (Year) obj; return (this.year == that.year); } Year();  Year(int year);  Year(Date time);  Year(Date time, TimeZone zone, Locale locale); int getYear(); @Override long getFirstMillisecond(); @Override long getLastMillisecond(); @Override void peg(Calendar calendar); @Override RegularTimePeriod previous(); @Override RegularTimePeriod next(); @Override long getSerialIndex(); @Override long getFirstMillisecond(Calendar calendar); @Override long getLastMillisecond(Calendar calendar); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(TimePeriod o1); @Override String toString(); static Year parseYear(String s); static final int MINIMUM_YEAR; static final int MAXIMUM_YEAR; }