@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } AttachmentItem that = (AttachmentItem) o; if (!attachment.equals(that.attachment)) { return false; } if (thumbnail != null ? !thumbnail.equals(that.thumbnail) : that.thumbnail != null) { return false; } return true; }