class ProjectApplication {

    @Override
    public boolean equals(Object obj) {
        if(this == obj) {
            return true;
        }

        if(obj instanceof ProjectApplication) {
            ProjectApplication other = (ProjectApplication) obj;

            // only compare the user IDs because of the cyclic reference: User <-> Application
            boolean userEquals = Objects.nonNull(this.user) && Objects.nonNull(other.user)
                    && Objects.equals(this.user.getId(), other.user.getId());

            return userEquals &&
                    Objects.equals(this.id, other.id) &&
                    Objects.equals(this.comment, other.comment) &&
                    Objects.equals(this.project, other.project) &&
                    Objects.equals(this.applicationDate, other.applicationDate);
        }

        return false;
    }

    public  ProjectApplication(Project project, String comment, User user, LocalDateTime applicationDate);

}