public int compareTo(ExamDifficultyWeight other) { return new CompareToBuilder() .append(studentSizeTotal, other.studentSizeTotal) .append(maximumDuration, other.maximumDuration) .append(exam instanceof LeadingExam, other.exam instanceof LeadingExam) .append(exam.getId(), other.exam.getId()) .toComparison(); }