public void testHashCodeDifferentRows(){
  Set<Model> set=new HashSet<Model>();
  Model m1=new MockModel();
  Model m2=new MockModel();
  Model m3;
  m1.save();
  m2.save();
  m3=Model.load(MockModel.class,m1.getId());
  assertEquals(m1.hashCode(),m3.hashCode());
  assertFalse(m1.hashCode() == m2.hashCode());
  set.add(m1);
  set.add(m2);
  set.add(m3);
  assertEquals(2,set.size());
}

public void testHashCodeDifferentRows ( ) { Set < Model > set = new HashSet < Model > ( ) ; Model m1 = new MockModel ( ) ; Model m2 = new MockModel ( ) ; Model m3 ; m1 . save ( ) ; m2 . save ( ) ; m3 = Model . load ( MockModel . class , m1 . getId ( ) ) ; assertEquals ( m1 . hashCode ( ) , m3 . hashCode ( ) ) ; assertFalse ( m1 . hashCode ( ) == m2 . hashCode ( ) ) ; set . add ( m1 ) ; set . add ( m2 ) ; set . add ( m3 ) ; assertEquals ( 2 , set . size ( ) ) ; }
two rows in a table should have different hashcodes .
