@Test
public void addApplicationBelongsToUser() {

    // given
    User user = new User("user");
    given(applicationMock.getUser()).willReturn(user);
    // when
    user.addApplication(applicationMock);
    // then
    assertThat(user.applications).containsExactly(applicationMock);
}