public void testDifference(){
Map<Address, Digest.Entry> map=new HashMap<Address, Digest.Entry>();
map.put(a1, new Digest.Entry(4, 500, 501));
map.put(a2, new Digest.Entry(25, 26, 26));
map.put(a3, new Digest.Entry(20, 25, 33));
Digest digest =new Digest(map);
Map<Address, Digest.Entry> map2=new HashMap<Address, Digest.Entry>();
map2.put(a1, new Digest.Entry(4, 500, 501));
map2.put(a2, new Digest.Entry(25, 26, 26));
map2.put(a3, new Digest.Entry(20, 37, 33));
Digest digest2 =new Digest(map2);
Assert.assertNotSame(digest, digest2);
Digest diff = digest2.difference(digest);
System.out.println(diff);
assert diff.contains(a3);
Assert.assertEquals(1, diff.size());
Map<Address, Digest.Entry> map3=new HashMap<Address, Digest.Entry>();
map3.put(a1, new Digest.Entry(4, 500, 501));
map3.put(a2, new Digest.Entry(25, 26, 26));
map3.put(a3, new Digest.Entry(20, 37, 33));
map3.put(Util.createRandomAddress(), new Digest.Entry(1, 2, 3));
Digest digest3 =new Digest(map3);
diff = digest3.difference(digest);
System.out.println(diff);
Assert.assertEquals(2, diff.size());
diff = digest3.difference(digest2);
System.out.println(diff);
Assert.assertEquals(1, diff.size());
Digest diff2 = digest2.difference(digest3);
System.out.println(diff2);
Assert.assertEquals(1, diff2.size());
Assert.assertEquals(diff, diff2);
}