test_class.declarator: applicationMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ProjectApplication applicationMock;
test_class.type: ProjectApplication
test_class.var_name: applicationMock
test_class.declarator: accessIntervalMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AccessInterval accessIntervalMock;
test_class.type: AccessInterval
test_class.var_name: accessIntervalMock
test_class.file: backend/project-board/src/test/java/de/adesso/projectboard/base/user/persistence/UserTest.java
test_class.identifier: UserTest
test_case.body: @Test
      public void addAccessIntervalAddsIntervalWhenItBelongsToUser() {
          // given
          User user = new User("user");
  
          given(accessIntervalMock.getUser()).willReturn(user);
  
          // when
          user.addAccessInterval(accessIntervalMock);
  
          // then
          assertThat(user.accessIntervals).containsExactly(accessIntervalMock);
      }
test_case.class_method_signature: UserTest.addAccessIntervalAddsIntervalWhenItBelongsToUser()
test_case.full_signature: @Test public void addAccessIntervalAddsIntervalWhenItBelongsToUser()
test_case.identifier: addAccessIntervalAddsIntervalWhenItBelongsToUser
test_case.invocations: willReturn given getUser addAccessInterval containsExactly assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void addAccessIntervalAddsIntervalWhenItBelongsToUser()
focal_class.declarator: id
focal_class.modifier: @Id
focal_class.original_string: @Id
      String id;
focal_class.type: String
focal_class.var_name: id
focal_class.declarator: bookmarks
focal_class.modifier: @ManyToMany
      @JoinTable(
              name = "PB_USER_BOOKMARKS",
              joinColumns = @JoinColumn(name = "USER_ID"),
              inverseJoinColumns = @JoinColumn(name = "PROJECT_ID")
      )
focal_class.original_string: @ManyToMany
      @JoinTable(
              name = "PB_USER_BOOKMARKS",
              joinColumns = @JoinColumn(name = "USER_ID"),
              inverseJoinColumns = @JoinColumn(name = "PROJECT_ID")
      )
      Set<Project> bookmarks;
focal_class.type: Set<Project>
focal_class.var_name: bookmarks
focal_class.declarator: applications
focal_class.modifier: @OneToMany(
              cascade = CascadeType.ALL,
              orphanRemoval = true,
              mappedBy = "user"
      )
focal_class.original_string: @OneToMany(
              cascade = CascadeType.ALL,
              orphanRemoval = true,
              mappedBy = "user"
      )
      Set<ProjectApplication> applications;
focal_class.type: Set<ProjectApplication>
focal_class.var_name: applications
focal_class.declarator: accessIntervals
focal_class.modifier: @OneToMany(
              cascade = CascadeType.ALL,
              orphanRemoval = true,
              mappedBy = "user"
      )
focal_class.original_string: @OneToMany(
              cascade = CascadeType.ALL,
              orphanRemoval = true,
              mappedBy = "user"
      )
      List<AccessInterval> accessIntervals;
focal_class.type: List<AccessInterval>
focal_class.var_name: accessIntervals
focal_class.file: backend/project-board/src/main/java/de/adesso/projectboard/base/user/persistence/User.java
focal_class.identifier: User
focal_class.class_method_signature: User.User(String userId)
focal_class.full_signature: public  User(String userId)
focal_class.identifier: User
focal_class.modifiers: public
focal_class.parameters: (String userId)
focal_class.signature:  User(String userId)
focal_class.class_method_signature: User.User()
focal_class.full_signature: protected  User()
focal_class.identifier: User
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.signature:  User()
focal_class.class_method_signature: User.addBookmark(Project project)
focal_class.full_signature: public void addBookmark(Project project)
focal_class.identifier: addBookmark
focal_class.modifiers: public
focal_class.parameters: (Project project)
focal_class.return: void
focal_class.signature: void addBookmark(Project project)
focal_class.class_method_signature: User.removeBookmark(Project project)
focal_class.full_signature: public void removeBookmark(Project project)
focal_class.identifier: removeBookmark
focal_class.modifiers: public
focal_class.parameters: (Project project)
focal_class.return: void
focal_class.signature: void removeBookmark(Project project)
focal_class.class_method_signature: User.addApplication(ProjectApplication application)
focal_class.full_signature: public void addApplication(ProjectApplication application)
focal_class.identifier: addApplication
focal_class.modifiers: public
focal_class.parameters: (ProjectApplication application)
focal_class.return: void
focal_class.signature: void addApplication(ProjectApplication application)
focal_class.class_method_signature: User.removeApplication(ProjectApplication application)
focal_class.full_signature: public void removeApplication(ProjectApplication application)
focal_class.identifier: removeApplication
focal_class.modifiers: public
focal_class.parameters: (ProjectApplication application)
focal_class.return: void
focal_class.signature: void removeApplication(ProjectApplication application)
focal_class.class_method_signature: User.getLatestAccessInterval()
focal_class.full_signature: public Optional<AccessInterval> getLatestAccessInterval()
focal_class.identifier: getLatestAccessInterval
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Optional<AccessInterval>
focal_class.signature: Optional<AccessInterval> getLatestAccessInterval()
focal_class.class_method_signature: User.addAccessInterval(AccessInterval interval)
focal_class.full_signature: public void addAccessInterval(AccessInterval interval)
focal_class.identifier: addAccessInterval
focal_class.modifiers: public
focal_class.parameters: (AccessInterval interval)
focal_class.return: void
focal_class.signature: void addAccessInterval(AccessInterval interval)
focal_class.class_method_signature: User.removeAccessInterval(AccessInterval interval)
focal_class.full_signature: public void removeAccessInterval(AccessInterval interval)
focal_class.identifier: removeAccessInterval
focal_class.modifiers: public
focal_class.parameters: (AccessInterval interval)
focal_class.return: void
focal_class.signature: void removeAccessInterval(AccessInterval interval)
focal_method.body: public void addAccessInterval(AccessInterval interval) throws IllegalArgumentException {
          Objects.requireNonNull(interval);
  
          if(!this.equals(interval.getUser())) {
              throw new IllegalArgumentException("Interval instance belongs to a different or no user!");
          }
  
          accessIntervals.add(interval);
      }
focal_method.class_method_signature: User.addAccessInterval(AccessInterval interval)
focal_method.full_signature: public void addAccessInterval(AccessInterval interval)
focal_method.identifier: addAccessInterval
focal_method.invocations: requireNonNull equals getUser add
focal_method.modifiers: public
focal_method.parameters: (AccessInterval interval)
focal_method.return: void
focal_method.signature: void addAccessInterval(AccessInterval interval)