AlbumUni_1_M_1_M b11 = new AlbumUni_1_M_1_M();
b11.setAlbumId("b1");
AlbumUni_1_M_1_M b12 = new AlbumUni_1_M_1_M();
b12.setAlbumId("b2");
PhotoUni_1_M_1_M c11 = new PhotoUni_1_M_1_M();
c11.setPhotoId("c1");
PhotoUni_1_M_1_M c12 = new PhotoUni_1_M_1_M();
c12.setPhotoId("c2");
PhotoUni_1_M_1_M c13 = new PhotoUni_1_M_1_M();
c13.setPhotoId("c3");
PhotoUni_1_M_1_M c14 = new PhotoUni_1_M_1_M();
c14.setPhotoId("c4");
b11.addPhoto(c11);
b11.addPhoto(c12);
b12.addPhoto(c13);
b12.addPhoto(c14);
a1.addAlbum(b11);
a1.addAlbum(b12);
// Object2
PhotographerUni_1_M_1_M a2 = new PhotographerUni_1_M_1_M();
a2.setPhotographerId(1);
AlbumUni_1_M_1_M b21 = new AlbumUni_1_M_1_M();
b21.setAlbumId("b1");
AlbumUni_1_M_1_M b22 = new AlbumUni_1_M_1_M();
b22.setAlbumId("b2");
PhotoUni_1_M_1_M c21 = new PhotoUni_1_M_1_M();
c21.setPhotoId("c1");
PhotoUni_1_M_1_M c22 = new PhotoUni_1_M_1_M();
c22.setPhotoId("c2");
PhotoUni_1_M_1_M c23 = new PhotoUni_1_M_1_M();
c23.setPhotoId("c3");
PhotoUni_1_M_1_M c24 = new PhotoUni_1_M_1_M();
c24.setPhotoId("c4");
b21.addPhoto(c21);
b21.addPhoto(c22);
b22.addPhoto(c23);
b22.addPhoto(c24);
a2.addAlbum(b21);
a2.addAlbum(b22);
// Equality test
assertTrue(DeepEquals.deepEquals(a1, a2));
// Inequality test
a2.setPhotographerId(2);
assertFalse(DeepEquals.deepEquals(a1, a2));
a2.setPhotographerId(1);
// Case 1: All same
assertTrue(DeepEquals.deepEquals(a1, a2));
assertTrue(DeepEquals.deepEquals(b12, b22));
assertTrue(DeepEquals.deepEquals(c14, c24));
// Case 2: Change Photo object
String originalPhotoCaption = c24.getPhotoCaption();
c24.setPhotoCaption("AAAAAAAAAAAAA");
assertTrue(DeepEquals.deepEquals(a1, a2));
assertTrue(DeepEquals.deepEquals(b12, b22));
assertFalse(DeepEquals.deepEquals(c14, c24));
c24.setPhotoCaption(originalPhotoCaption);
// Case 3: Change Album object
String originalAlbumDiscription = b22.getAlbumDescription();
b22.setAlbumDescription("Second Album of Second Photographer");
assertTrue(DeepEquals.deepEquals(a1, a2));
assertFalse(DeepEquals.deepEquals(b12, b22));
assertTrue(DeepEquals.deepEquals(c14, c24));
b22.setAlbumDescription(originalAlbumDiscription);
// Case 4: Change album and photo object
c24.setPhotoCaption("AAAAAAAAAAAAA");
b22.setAlbumDescription("Second Album of Second Photographer");
assertTrue(DeepEquals.deepEquals(a1, a2));
assertFalse(DeepEquals.deepEquals(b12, b22));
assertFalse(DeepEquals.deepEquals(c14, c24));
b22.setAlbumDescription(originalAlbumDiscription);
c24.setPhotoCaption(originalPhotoCaption);
// Case 5: Change Photographer object
String originalPhotographerName = a2.getPhotographerName();
a2.setPhotographerName("Kuldeep");
assertFalse(DeepEquals.deepEquals(a1, a2));
assertTrue(DeepEquals.deepEquals(b12, b22));
assertTrue(DeepEquals.deepEquals(c14, c24));
a2.setPhotographerName(originalPhotographerName);
// Case 6: Change Photographer and photo object
c24.setPhotoCaption("AAAAAAAAAAAAA");
a2.setPhotographerName("Kuldeep");
assertFalse(DeepEquals.deepEquals(a1, a2));
assertTrue(DeepEquals.deepEquals(b12, b22));
assertFalse(DeepEquals.deepEquals(c14, c24));
a2.setPhotographerName(originalPhotographerName);
c24.setPhotoCaption(originalPhotoCaption);
// Case 7: Change Photographer and album object
b22.setAlbumDescription("Second Album of Second Photographer");
a2.setPhotographerName("Kuldeep");
assertFalse(DeepEquals.deepEquals(a1, a2));
assertFalse(DeepEquals.deepEquals(b12, b22));
assertTrue(DeepEquals.deepEquals(c14, c24));
a2.setPhotographerName(originalPhotographerName);
b22.setAlbumDescription(originalAlbumDiscription);
// Case 8: Change Photographer, album and photo object
c24.setPhotoCaption("AAAAAAAAAAAAA");
b22.setAlbumDescription("Second Album of Second Photographer");
a2.setPhotographerName("Kuldeep");
assertFalse(DeepEquals.deepEquals(a1, a2));
assertFalse(DeepEquals.deepEquals(b12, b22));
assertFalse(DeepEquals.deepEquals(c14, c24));
a2.setPhotographerName(originalPhotographerName);
b22.setAlbumDescription(originalAlbumDiscription);
c24.setPhotoCaption(originalPhotoCaption);
}