@Test
public void removeUserShouldCancelFileTransfers() {

    final User user = new User("User1", 124);
    userList.add(user);
    final FileReceiver fileReceiver1 = mock(FileReceiver.class);
    final FileReceiver fileReceiver2 = mock(FileReceiver.class);
    when(transferList.getFileReceivers(user)).thenReturn(Arrays.asList(fileReceiver1, fileReceiver2));
    final FileSender fileSender1 = mock(FileSender.class);
    final FileSender fileSender2 = mock(FileSender.class);
    when(transferList.getFileSenders(user)).thenReturn(Arrays.asList(fileSender1, fileSender2));
    controller.removeUser(user, "Bla bla");
    verify(fileReceiver1).cancel();
    verify(fileReceiver2).cancel();
    verify(fileSender1).cancel();
    verify(fileSender2).cancel();
    verify(transferList).removeFileReceiver(fileReceiver1);
    verify(transferList).removeFileReceiver(fileReceiver2);
    verify(transferList).removeFileSender(fileSender1);
    verify(transferList).removeFileSender(fileSender2);
}