Can someone give me a hint why the line "community.getAccounts().remove(acc);" does not remove the object from the set?
thx
Code:
@Test
public void testTest(){
String name = "XYZ";
String player = "Mario";
accountService.saveAccount(new Account(player, "topsecret"));
Account acc = accountService.findAccoutnByName(player);
Community community = new Community(name);
Set<Account> x = new HashSet<Account>();
x.add(acc);
community.setAccounts(x);
communityService.saveCommunity(community);
community = communityService.findCommunityByName(name);
community.getAccounts().remove(acc);
communityService.saveCommunity(community);
}