@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Group)) { return false; } Group group = (Group) obj; long primaryKey = group.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } Group group = null; try { group = (Group) obj; } catch (ClassCastException cce) { return false; } long primaryKey = group.getPrimaryKey(); if (getPrimaryKey() == primaryKey) { return true; } else { return false; } }