### Question:
JibContainer { @Override public int hashCode() { return Objects.hash(targetImage, imageDigest, imageId, tags); } @VisibleForTesting  JibContainer(
      ImageReference targetImage,
      DescriptorDigest imageDigest,
      DescriptorDigest imageId,
      Set<String> tags); ImageReference getTargetImage(); DescriptorDigest getDigest(); DescriptorDigest getImageId(); Set<String> getTags(); @Override int hashCode(); @Override boolean equals(Object other);  }### Answer:
@Test public void testEquality() { JibContainer container1 = new JibContainer(targetImage1, digest1, digest2, tags1); JibContainer container2 = new JibContainer(targetImage1, digest1, digest2, tags1); Assert.assertEquals(container1, container2); Assert.assertEquals(container1.hashCode(), container2.hashCode()); }
@Test public void testEquality_differentTargetImage() { JibContainer container1 = new JibContainer(targetImage1, digest1, digest2, tags1); JibContainer container2 = new JibContainer(targetImage2, digest1, digest2, tags1); Assert.assertNotEquals(container1, container2); Assert.assertNotEquals(container1.hashCode(), container2.hashCode()); }
@Test public void testEquality_differentImageDigest() { JibContainer container1 = new JibContainer(targetImage1, digest1, digest2, tags1); JibContainer container2 = new JibContainer(targetImage1, digest2, digest2, tags1); Assert.assertNotEquals(container1, container2); Assert.assertNotEquals(container1.hashCode(), container2.hashCode()); }
@Test public void testEquality_differentImageId() { JibContainer container1 = new JibContainer(targetImage1, digest1, digest1, tags1); JibContainer container2 = new JibContainer(targetImage1, digest1, digest2, tags1); Assert.assertNotEquals(container1, container2); Assert.assertNotEquals(container1.hashCode(), container2.hashCode()); }
@Test public void testEquality_differentTags() { JibContainer container1 = new JibContainer(targetImage1, digest1, digest1, tags1); JibContainer container2 = new JibContainer(targetImage1, digest1, digest1, tags2); Assert.assertNotEquals(container1, container2); Assert.assertNotEquals(container1.hashCode(), container2.hashCode()); }