DateTimeRFC6265 { @Override public boolean equals(Object o){ return o instanceof DateTimeRFC6265 && o.toString().equals(toString()); } DateTimeRFC6265(DayOfWeek dayOfWeek, int dayOfMonth, MonthOfYear monthOfYear, int year, int hours, int minutes, int seconds, String timezone);  DateTimeRFC6265(String text); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object o);  }
@Test public void inequality(){ DateTimeRFC6265 a = new DateTimeRFC6265("Tue, 15 Jan 2013 21:47:38 GMT"); DateTimeRFC6265 b = new DateTimeRFC6265("Thu, 01 Jan 1970 00:00:01 GMT"); boolean result = a.equals(b); Assert.assertEquals(false, result); }
@Test public void equality(){ DateTimeRFC6265 a = new DateTimeRFC6265("Tue, 15 Jan 2013 21:47:38 GMT"); DateTimeRFC6265 b = new DateTimeRFC6265("Tue, 15 Jan 2013 21:47:38 GMT"); boolean result = a.equals(b); Assert.assertEquals(true, result); }