public void testHashCode(){
  Set<Model> set=new HashSet<Model>();
  Model m1=new MockModel();
  Model m2=new MockModel();
  Model m3=new AnotherMockModel();
  assertFalse(m1.hashCode() == m2.hashCode());
  set.add(m1);
  set.add(m2);
  assertEquals(2,set.size());
  assertFalse(m1.hashCode() == m3.hashCode());
  set.add(m3);
  assertEquals(3,set.size());
}

public void testHashCode ( ) { Set < Model > set = new HashSet < Model > ( ) ; Model m1 = new MockModel ( ) ; Model m2 = new MockModel ( ) ; Model m3 = new AnotherMockModel ( ) ; assertFalse ( m1 . hashCode ( ) == m2 . hashCode ( ) ) ; set . add ( m1 ) ; set . add ( m2 ) ; assertEquals ( 2 , set . size ( ) ) ; assertFalse ( m1 . hashCode ( ) == m3 . hashCode ( ) ) ; set . add ( m3 ) ; assertEquals ( 3 , set . size ( ) ) ; }
tests hashcode for new instances .
