src/edu/kit/informatik/campusmanagement/Student.java
/**
     * Adds the lecture to the student.
     * 
     * @param  lecture the lecture to add
     * @throws java.util.NoSuchElementException if the student has no grade set in the lecture
     * @throws IllegalStateException if the lecture was already added
     */
Adds the lecture to the student.

@param  lecture the lecture to add
@throws java.util.NoSuchElementException if the student has no grade set in the lecture
@throws IllegalStateException if the lecture was already added
Adds the lecture to the student . @param lecture the lecture to add @throws java . util . NoSuchElementException if the student has no grade set in the lecture @throws IllegalStateException if the lecture was already added
void add(
            final Lecture lecture) {
        lecture.grade(this); 
        if (!grades.computeIfAbsent(lecture.module(), (module) -> new TreeSet<>()).add(lecture)) {
            throw new IllegalStateException("lecture already added");
        }
    }
void add ( final Lecture lecture ) { lecture . grade ( this ) ; if ( ! grades . computeIfAbsent ( lecture . module ( ) , ( module ) -> new TreeSet < > ( ) ) . add ( lecture ) ) { throw new IllegalStateException ( "lecture already added" ) ; } }
Adds the lecture to the student.
Adds the lecture to the student .
//// // throws NoSuchElementException if required