@Test
public void logOffShouldCancelFileTransfersWhenRemoveUsersIsFalse() {

    final User user1 = new User("User1", 124);
    userList.add(user1);
    final FileReceiver fileReceiver1 = mock(FileReceiver.class);
    when(transferList.getFileReceivers(user1)).thenReturn(Arrays.asList(fileReceiver1));
    final User user2 = new User("User2", 125);
    userList.add(user2);
    final FileSender fileSender1 = mock(FileSender.class);
    when(transferList.getFileSenders(user2)).thenReturn(Arrays.asList(fileSender1));
    controller.logOff(false);
    verify(fileReceiver1).cancel();
    verify(fileSender1).cancel();
    verify(transferList).removeFileReceiver(fileReceiver1);
    verify(transferList).removeFileSender(fileSender1);
}