ArchivedJson { @Override public boolean equals(Object obj) { if (obj instanceof ArchivedJson) { ArchivedJson other = (ArchivedJson) obj; return this.path.equals(other.path) && this.json.equals(other.json); } else { return false; } } ArchivedJson(String path, String json); String getPath(); String getJson(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() { ArchivedJson original = new ArchivedJson("path", "json"); ArchivedJson twin = new ArchivedJson("path", "json"); ArchivedJson identicalPath = new ArchivedJson("path", "hello"); ArchivedJson identicalJson = new ArchivedJson("hello", "json"); Assert.assertEquals(original, original); Assert.assertEquals(original, twin); Assert.assertNotEquals(original, identicalPath); Assert.assertNotEquals(original, identicalJson); }