Index: protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java	(revision 11)
+++ protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java	(revision 14)
@@ -23,5 +23,4 @@
 import geniusweb.references.PartyRef;
 import geniusweb.references.PartyWithParameters;
-import geniusweb.references.PartyWithProfile;
 import geniusweb.references.ProfileRef;
 import tudelft.utilities.junit.GeneralTests;
@@ -33,13 +32,14 @@
 	private final ObjectMapper jackson = new ObjectMapper();
 
-	private final String serialized = "{\"AllPermutationsSettings\":{\"parties\":[{\"partyref\":\"party1\",\"parameters\":{}},{\"partyref\":\"party2\",\"parameters\":{}}],\"reuseParties\":false,\"profiles\":[\"profile1\",\"profile2\",\"profile3\"],\"partiesPerSession\":2,\"sessionsettings\":{\"SAOPSettings\":{\"participants\":[],\"deadline\":{\"deadlinetime\":{\"durationms\":10000}}}}}}";
+	private final String serialized = "{\"AllPermutationsSettings\":{\"teams\":[{\"Team\":[{\"partyref\":\"party1\",\"parameters\":{}}]},{\"Team\":[{\"partyref\":\"party2\",\"parameters\":{}}]}],\"profileslists\":[{\"ProfileList\":[\"profile1\"]},{\"ProfileList\":[\"profile2\"]},{\"ProfileList\":[\"profile3\"]}],\"reuseTeams\":false,\"teamsPerSession\":2,\"sessionsettings\":{\"SAOPSettings\":{\"participants\":[],\"deadline\":{\"deadlinetime\":{\"durationms\":10000}}}}}}";
 	private AllPermutationsSettings settings, settings1a, settings2, settings3,
 			settings4;
 
+	// use directly because there is some hard coding currently.
 	private SAOPSettings saopsettings;
 
 	private ProfileRef profile1, profile2, profile3;
-
-	private List<PartyWithParameters> parties;
+	private ProfileList profiles1, profiles2, profiles3;
+	private List<Team> parties;
 
 	@Before
@@ -53,10 +53,10 @@
 		Parameters params3 = new Parameters();
 
-		PartyWithParameters partywithparams1 = new PartyWithParameters(
-				partyref1, params1);
-		PartyWithParameters partywithparams2 = new PartyWithParameters(
-				partyref2, params2);
-		PartyWithParameters partywithparams3 = new PartyWithParameters(
-				partyref3, params3);
+		Team partywithparams1 = new Team(
+				Arrays.asList(new PartyWithParameters(partyref1, params1)));
+		Team partywithparams2 = new Team(
+				Arrays.asList(new PartyWithParameters(partyref2, params2)));
+		Team partywithparams3 = new Team(
+				Arrays.asList(new PartyWithParameters(partyref3, params3)));
 
 		parties = Arrays.asList(partywithparams1, partywithparams2);
@@ -68,23 +68,27 @@
 		profile2 = new ProfileRef("profile2");
 		profile3 = new ProfileRef("profile3");
-
-		List<ProfileRef> profiles = Arrays.asList(profile1, profile2, profile3);
-
-		settings = new AllPermutationsSettings(parties, false, profiles, 2,
-				saopsettings);
-
-		settings1a = new AllPermutationsSettings(parties, false, profiles, 2,
+		ProfileList profiles1 = new ProfileList(Arrays.asList(profile1));
+		ProfileList profiles2 = new ProfileList(Arrays.asList(profile2));
+		ProfileList profiles3 = new ProfileList(Arrays.asList(profile3));
+
+		List<ProfileList> profiles = Arrays.asList(profiles1, profiles2,
+				profiles3);
+
+		settings = new AllPermutationsSettings(parties, profiles, false, 2,
+				saopsettings);
+
+		settings1a = new AllPermutationsSettings(parties, profiles, false, 2,
 				saopsettings);
 
 		settings2 = new AllPermutationsSettings(Arrays.asList(partywithparams1,
-				partywithparams2, partywithparams3), false, profiles, 2,
-				saopsettings);
-
-		settings3 = new AllPermutationsSettings(parties, true, profiles, 2,
-				saopsettings);
-
-		settings4 = new AllPermutationsSettings(parties, false,
-				Arrays.asList(profile1, profile2, profile3, profile1), 2,
-				saopsettings);
+				partywithparams2, partywithparams3), profiles, false, 2,
+				saopsettings);
+
+		settings3 = new AllPermutationsSettings(parties, profiles, true, 2,
+				saopsettings);
+
+		settings4 = new AllPermutationsSettings(parties,
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1),
+				false, 2, saopsettings);
 
 	}
@@ -131,7 +135,7 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullParties() {
-		new AllPermutationsSettings(null, true,
-				Arrays.asList(profile1, profile2, profile3, profile1), 2,
-				saopsettings);
+		new AllPermutationsSettings(null,
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
+				2, saopsettings);
 
 	}
@@ -139,7 +143,7 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testNoParties() {
-		new AllPermutationsSettings(Collections.emptyList(), true,
-				Arrays.asList(profile1, profile2, profile3, profile1), 2,
-				saopsettings);
+		new AllPermutationsSettings(Collections.emptyList(),
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
+				2, saopsettings);
 
 	}
@@ -147,5 +151,5 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullProfiles() {
-		new AllPermutationsSettings(parties, true, null, 2, saopsettings);
+		new AllPermutationsSettings(parties, null, true, 2, saopsettings);
 
 	}
@@ -153,7 +157,7 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testInsufficientProfiles() {
-		new AllPermutationsSettings(parties, true,
-				Arrays.asList(profile1, profile2, profile3, profile1), 4,
-				saopsettings);
+		new AllPermutationsSettings(parties,
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
+				4, saopsettings);
 
 	}
@@ -161,6 +165,7 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullSessionSettings() {
-		new AllPermutationsSettings(parties, true,
-				Arrays.asList(profile1, profile2, profile3, profile1), 4, null);
+		new AllPermutationsSettings(parties,
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
+				4, null);
 
 	}
@@ -168,7 +173,7 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testOnePartyPerSession() {
-		new AllPermutationsSettings(parties, true,
-				Arrays.asList(profile1, profile2, profile3, profile1), 1,
-				saopsettings);
+		new AllPermutationsSettings(parties,
+				Arrays.asList(profiles1, profiles2, profiles3, profiles1), true,
+				1, saopsettings);
 
 	}
@@ -180,18 +185,18 @@
 	}
 
-	@Test
-	public void makeCobTest() throws URISyntaxException {
-		// Check that the cob party gets profile without the query part
-		String profilebase = "ws://1.2.3.4:8080/profilesserver-a.b.c/websocket/get/someprofile";
-		String partybase = "http://131.180.202.213:8080/partiesserver/run/";
-		String query = "?a=2&partial=4";
-		PartyWithProfile partyprofile = AllPermutationsSettings.makeCob(
-				new PartyRef(partybase + AllPermutationsSettings.COB_PARTY),
-				new ProfileRef(profilebase + query));
-		assertEquals(profilebase,
-				partyprofile.getProfile().getURI().toString());
-		assertEquals(partybase + AllPermutationsSettings.COB_PARTY,
-				partyprofile.getParty().getPartyRef().getURI().toString());
-	}
+//	@Test
+//	public void makeCobTest() throws URISyntaxException {
+//		// Check that the cob party gets profile without the query part
+//		String profilebase = "ws://1.2.3.4:8080/profilesserver-a.b.c/websocket/get/someprofile";
+//		String partybase = "http://131.180.202.213:8080/partiesserver/run/";
+//		String query = "?a=2&partial=4";
+//		PartyWithProfile partyprofile = AllPermutationsSettings.makeCob(
+//				new PartyRef(partybase + AllPermutationsSettings.COB_PARTY),
+//				new ProfileRef(profilebase + query));
+//		assertEquals(profilebase,
+//				partyprofile.getProfile().getURI().toString());
+//		assertEquals(partybase + AllPermutationsSettings.COB_PARTY,
+//				partyprofile.getParty().getPartyRef().getURI().toString());
+//	}
 
 }
