@Test public void testNotEquals() { Map<String, Object> ids1 = new HashMap<>(); ids1.put("id1", new Integer(1)); ids1.put("id2", "2"); CompoundObjectId objectId1 = new CompoundObjectId(ids1); assertFalse(objectId1.equals(new String("2"))); assertFalse(objectId1.equals(new CompoundObjectId(new HashMap<>()))); Map<String, Object> ids2 = new HashMap<>(); ids2.put("id1", new Integer(-1)); ids2.put("id2", "2"); CompoundObjectId objectId2 = new CompoundObjectId(ids2); assertFalse(objectId1.equals(objectId2)); }
@Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); @Override Object get(String attributeName); @Override Object get(); @Override int size(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static String mapToString(Map<String, Object> m); }
CompoundObjectId extends BaseObjectId { @Override public boolean equals(Object object) { if (this == object) { return true; } if (!(object instanceof CompoundObjectId)) { return false; } return id.equals(((CompoundObjectId)object).id); } CompoundObjectId(Map<String, Object> id); @Override Object get(String attributeName); @Override Object get(); @Override int size(); @Override String toString(); @Override boolean equals(Object object); @Override int hashCode(); static String mapToString(Map<String, Object> m);  }