@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Ballot ballot = (Ballot) o; if (id == null || ballot.id == null) return false; return id.equals(ballot.id); }
@Override public int hashCode() { return id != null ? id.hashCode() : -1; }