public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof LocalDateTime) { LocalDateTime other = (LocalDateTime) obj; return date.equals(other.date) && time.equals(other.time); } return false; }