Index: protocol/src/main/java/geniusweb/protocol/tournament/TournamentState.java
===================================================================
--- protocol/src/main/java/geniusweb/protocol/tournament/TournamentState.java	(revision 11)
+++ protocol/src/main/java/geniusweb/protocol/tournament/TournamentState.java	(revision 14)
@@ -7,6 +7,8 @@
 
 /**
- * The current state of the tournament. Must be serializabl;e so that it can be
- * restarted if a crash occurs.
+ * The current state of the tournament. Must be implement Json serialization so
+ * that it can be used to log the state. State must contain all information to
+ * determine the relevant info of the negotiation. It may also be used to
+ * restart the nego if a crash occurs.
  */
 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
Index: protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java
===================================================================
--- protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java	(revision 11)
+++ protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java	(revision 14)
@@ -1,6 +1,4 @@
 package geniusweb.protocol.tournament.allpermutations;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Collections;
 import java.util.List;
@@ -9,5 +7,4 @@
 import com.fasterxml.jackson.annotation.JsonProperty;
 
-import geniusweb.profile.Profile;
 import geniusweb.protocol.session.SessionSettings;
 import geniusweb.protocol.session.TeamOfPartiesAndProfiles;
@@ -18,9 +15,5 @@
 import geniusweb.protocol.tournament.TournamentProtocol;
 import geniusweb.protocol.tournament.TournamentSettings;
-import geniusweb.references.Parameters;
-import geniusweb.references.PartyRef;
-import geniusweb.references.PartyWithParameters;
 import geniusweb.references.PartyWithProfile;
-import geniusweb.references.ProfileRef;
 import tudelft.utilities.immutablelist.FixedList;
 import tudelft.utilities.immutablelist.Function2;
@@ -68,45 +61,71 @@
 
 	public static final String COB_PARTY = "comparebids-1.2.0";
-	private final List<PartyWithParameters> parties;
-	private final List<ProfileRef> profiles;
-	private final boolean reuseParties;
-	private final int partiesPerSession;
+	private final List<Team> teams;
+	private final List<ProfileList> profileslists;
+	private final boolean reuseTeams;
+	private final int teamsPerSession;
 	private final SessionSettings sessionsettings;
 
 	/**
 	 * 
-	 * @param parties           a list of {@link PartyRef}s. Must contain at
-	 *                          least <partiesPerSession> elements.
-	 * @param reuseParties      if true, we use PermutationsWithReturn, if false
-	 *                          we use PermutationsWithoutReturn to create the
-	 *                          parties.
-	 * @param profiles          list of available {@link Profile}s to be
-	 *                          permutated over the parties
-	 * @param partiesPerSession number of parties per session, must be at least
-	 *                          2.
-	 * @param sesettings        The generic {@link SessionSetting}.
-	 *                          {@link SessionSettings#with(PartyWithProfile)}
-	 *                          will be used to add the required
-	 *                          {@link PartyWithProfile}s
+	 * @param teams           a list of {@link Team}s. Must contain at least
+	 *                        <partiesPerSession> elements. The <teamsize> must
+	 *                        match the protocol: (SAOP:1, SHAOP:2)
+	 * @param reuseTeams      if true, we use PermutationsWithReturn, if false
+	 *                        we use PermutationsWithoutReturn to create the
+	 *                        teams.
+	 * @param plists          list of available {@link ProfileList}s to be
+	 *                        permutated over the teams. Each
+	 *                        {@link ProfileList} must contain <teamsize>
+	 *                        elements.
+	 * @param teamsPerSession number of parties per session, must be at least 2.
+	 * @param sesettings      The generic {@link SessionSetting}.
+	 *                        {@link SessionSettings#with(PartyWithProfile)}
+	 *                        will be used to add the required
+	 *                        {@link PartyWithProfile}s
 	 */
 	@JsonCreator
-	public AllPermutationsSettings(
-			@JsonProperty("parties") List<PartyWithParameters> parties,
-			@JsonProperty("reuseParties") boolean reuseParties,
-			@JsonProperty("profiles") List<ProfileRef> profiles,
-			@JsonProperty("partiesPerSession") int partiesPerSession,
+	public AllPermutationsSettings(@JsonProperty("teams") List<Team> teams,
+			@JsonProperty("profileslists") List<ProfileList> plists,
+			@JsonProperty("reuseTeams") boolean reuseTeams,
+			@JsonProperty("teamsPerSession") int teamsPerSession,
 			@JsonProperty("sessionsettings") SessionSettings sesettings) {
-		if (partiesPerSession < 2)
-			throw new IllegalArgumentException("partiesPerSession must be >=2");
-		if (parties == null || parties.size() < partiesPerSession)
-			throw new IllegalArgumentException("parties must contain at least "
-					+ partiesPerSession + " PartyRefs");
-		if (profiles == null || profiles.size() < 2)
-			throw new IllegalArgumentException("profiles must contain at least "
-					+ partiesPerSession + " ProfileRefs");
-		this.partiesPerSession = partiesPerSession;
-		this.reuseParties = reuseParties;
-		this.parties = parties;
-		this.profiles = profiles;
+		if (teamsPerSession < 2)
+			throw new IllegalArgumentException("teamsPerSession must be >=2");
+		if (teams == null || teams.size() < teamsPerSession)
+			throw new IllegalArgumentException("teams must contain at least "
+					+ teamsPerSession + " teams");
+		if (plists == null || plists.size() < 2)
+			throw new IllegalArgumentException(
+					"profileslist must contain at least " + teamsPerSession
+							+ " ProfileList's");
+		int teamsize;
+		if (sesettings instanceof SAOPSettings)
+			teamsize = 1;
+		else if (sesettings instanceof SHAOPSettings)
+			teamsize = 2;
+		else
+			throw new IllegalArgumentException(
+					"Unsupported protocol " + sesettings.getClass());
+
+		for (Team team : teams) {
+			if (team.getParties().size() != teamsize) {
+				throw new IllegalArgumentException("All teams should have size "
+						+ teamsize + " but found " + team.getParties().size());
+			}
+		}
+		for (ProfileList profile : plists) {
+			if (profile.getProfiles().size() != teamsize) {
+				throw new IllegalArgumentException(
+						"All profiles should have size equal to the team size "
+								+ teamsize + " but found "
+								+ profile.getProfiles().size());
+
+			}
+		}
+		this.teamsPerSession = teamsPerSession;
+		this.reuseTeams = reuseTeams;
+		this.teams = teams;
+		this.profileslists = plists;
 		this.sessionsettings = sesettings;
 	}
@@ -131,10 +150,9 @@
 	public ImmutableList<SessionSettings> permutations() {
 		ImmutableList<ImmutableList<TeamOfPartiesAndProfiles>> partylistlist;
-		ImmutableList<PartyWithParameters> partieslist = new FixedList<PartyWithParameters>(
-				parties);
-		ImmutableList<ProfileRef> profileslist = new FixedList<ProfileRef>(
-				profiles);
+		ImmutableList<Team> partieslist = new FixedList<Team>(teams);
+		ImmutableList<ProfileList> profileslist = new FixedList<ProfileList>(
+				profileslists);
 		partylistlist = getParticipants(partieslist, profileslist,
-				partiesPerSession, reuseParties);
+				teamsPerSession, reuseTeams);
 		return new MapList<>(partyproflist -> createSetting(partyproflist),
 				partylistlist);
@@ -143,6 +161,6 @@
 	@Override
 	public String toString() {
-		return "AllPermutationsSettings[" + parties + "," + reuseParties + ","
-				+ profiles + "," + partiesPerSession + "," + sessionsettings
+		return "AllPermutationsSettings[" + teams + "," + reuseTeams + ","
+				+ profileslists + "," + teamsPerSession + "," + sessionsettings
 				+ "]";
 	}
@@ -152,9 +170,9 @@
 		final int prime = 31;
 		int result = 1;
-		result = prime * result + ((parties == null) ? 0 : parties.hashCode());
-		result = prime * result + partiesPerSession;
+		result = prime * result + ((teams == null) ? 0 : teams.hashCode());
+		result = prime * result + teamsPerSession;
 		result = prime * result
-				+ ((profiles == null) ? 0 : profiles.hashCode());
-		result = prime * result + (reuseParties ? 1231 : 1237);
+				+ ((profileslists == null) ? 0 : profileslists.hashCode());
+		result = prime * result + (reuseTeams ? 1231 : 1237);
 		result = prime * result
 				+ ((sessionsettings == null) ? 0 : sessionsettings.hashCode());
@@ -171,17 +189,17 @@
 			return false;
 		AllPermutationsSettings other = (AllPermutationsSettings) obj;
-		if (parties == null) {
-			if (other.parties != null)
+		if (teams == null) {
+			if (other.teams != null)
 				return false;
-		} else if (!parties.equals(other.parties))
-			return false;
-		if (partiesPerSession != other.partiesPerSession)
-			return false;
-		if (profiles == null) {
-			if (other.profiles != null)
+		} else if (!teams.equals(other.teams))
+			return false;
+		if (teamsPerSession != other.teamsPerSession)
+			return false;
+		if (profileslists == null) {
+			if (other.profileslists != null)
 				return false;
-		} else if (!profiles.equals(other.profiles))
-			return false;
-		if (reuseParties != other.reuseParties)
+		} else if (!profileslists.equals(other.profileslists))
+			return false;
+		if (reuseTeams != other.reuseTeams)
 			return false;
 		if (sessionsettings == null) {
@@ -219,9 +237,8 @@
 	 */
 	private ImmutableList<ImmutableList<TeamOfPartiesAndProfiles>> getParticipants(
-			ImmutableList<PartyWithParameters> parties,
-			ImmutableList<ProfileRef> profiles, int n,
-			boolean drawPartyWithPutback) {
-
-		Permutations<PartyWithParameters> partiesPermutations;
+			ImmutableList<Team> parties, ImmutableList<ProfileList> profiles,
+			int n, boolean drawPartyWithPutback) {
+
+		Permutations<Team> partiesPermutations;
 		if (drawPartyWithPutback) {
 			partiesPermutations = new PermutationsWithReturn<>(parties, n);
@@ -230,13 +247,13 @@
 		}
 
-		Permutations<ProfileRef> profilesPermutations = new PermutationsOrderedWithoutReturn<>(
+		Permutations<ProfileList> profilesPermutations = new PermutationsOrderedWithoutReturn<>(
 				profiles, n);
 
-		// each tuple contains sesion info: a list of partyref and a list of
-		// profileref's.
-		Tuples<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>> tuples = new Tuples<>(
+		// each tuple contains session info: a list of Team and a list of
+		// ProfileList.
+		Tuples<ImmutableList<Team>, ImmutableList<ProfileList>> tuples = new Tuples<>(
 				partiesPermutations, profilesPermutations);
 
-		return new MapList<Tuple<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>>, ImmutableList<TeamOfPartiesAndProfiles>>(
+		return new MapList<Tuple<ImmutableList<Team>, ImmutableList<ProfileList>>, ImmutableList<TeamOfPartiesAndProfiles>>(
 				tuple -> teamlist(tuple), tuples);
 	}
@@ -244,21 +261,24 @@
 	/**
 	 * 
-	 * @param tuple a tuple with (1) ImmutableList<PartyRef> (2)
-	 *              ImmutableList<ProfileRef>
+	 * @param tuple a tuple with (1) ImmutableList<Team> (2)
+	 *              ImmutableList<Profiles>
 	 * @return list of TeamOfPartiesAndProfiles, each picked from the two lists
 	 *         in order.
 	 */
 	private ImmutableList<TeamOfPartiesAndProfiles> teamlist(
-			Tuple<ImmutableList<PartyWithParameters>, ImmutableList<ProfileRef>> tuple) {
-		Function2<PartyWithParameters, ProfileRef, TeamOfPartiesAndProfiles> //
-		makeparty = new Function2<PartyWithParameters, ProfileRef, TeamOfPartiesAndProfiles>() {
+			Tuple<ImmutableList<Team>, ImmutableList<ProfileList>> tuple) {
+		Function2<Team, ProfileList, TeamOfPartiesAndProfiles> makeparty = new Function2<Team, ProfileList, TeamOfPartiesAndProfiles>() {
 			@Override
-			public TeamOfPartiesAndProfiles apply(PartyWithParameters party,
-					ProfileRef profile) {
+			public TeamOfPartiesAndProfiles apply(Team team,
+					ProfileList profilelist) {
 				if (sessionsettings instanceof SAOPSettings)
-					return new SaopPartyWithProfile(party, profile);
+					return new SaopPartyWithProfile(team.getParties().get(0),
+							profilelist.getProfiles().get(0));
 				else if (sessionsettings instanceof SHAOPSettings) {
-					return new ShaopTeam(new PartyWithProfile(party, profile),
-							makeCob(party.getPartyRef(), profile));
+					return new ShaopTeam(
+							new PartyWithProfile(team.getParties().get(0),
+									profilelist.getProfiles().get(0)),
+							new PartyWithProfile(team.getParties().get(1),
+									profilelist.getProfiles().get(1)));
 				} else
 					throw new IllegalArgumentException(
@@ -268,38 +288,38 @@
 
 		};
-		return new MapThreadList<TeamOfPartiesAndProfiles, PartyWithParameters, ProfileRef>(
+		return new MapThreadList<TeamOfPartiesAndProfiles, Team, ProfileList>(
 				makeparty, tuple.get1(), tuple.get2());
 	}
 
-	/**
-	 * Extract the raw URL, without the part after the question mark
-	 * 
-	 * @param party   a party reference (for another party)
-	 * @param profile a profile that may have a filter like "?partial=XX"
-	 * @return profile without the filter and with a cob party on the same
-	 *         machine. IT IS ASSUMED that there will the default
-	 *         "comparebids-1.0.0" party on the same machine as where the other
-	 *         party is
-	 */
-	protected static PartyWithProfile makeCob(PartyRef party,
-			ProfileRef profile) {
-		try {
-			URI profileuri = profile.getURI();
-			URI partyuri = party.getURI();
-			ProfileRef cobprof = new ProfileRef(profileuri.getScheme() + "://"
-					+ profileuri.getAuthority() + profileuri.getPath());
-			String partypath = partyuri.getPath();
-			partypath = partypath.substring(0, partypath.lastIndexOf('/'));
-			PartyWithParameters cobparty = new PartyWithParameters(new PartyRef(
-					partyuri.getScheme() + "://" + partyuri.getAuthority()
-							+ partypath + "/" + COB_PARTY),
-					new Parameters());
-			return new PartyWithProfile(cobparty, cobprof);
-
-		} catch (URISyntaxException e) {
-			throw new IllegalArgumentException(
-					"Failed making cob party with profile " + profile, e);
-		}
-	}
+//	/**
+//	 * Extract the raw URL, without the part after the question mark
+//	 * 
+//	 * @param party   a party reference (for another party)
+//	 * @param profile a profile that may have a filter like "?partial=XX"
+//	 * @return profile without the filter and with a cob party on the same
+//	 *         machine. IT IS ASSUMED that there will the default
+//	 *         "comparebids-1.0.0" party on the same machine as where the other
+//	 *         party is
+//	 */
+//	protected static PartyWithProfile makeCob(PartyRef party,
+//			ProfileRef profile) {
+//		try {
+//			URI profileuri = profile.getURI();
+//			URI partyuri = party.getURI();
+//			ProfileRef cobprof = new ProfileRef(profileuri.getScheme() + "://"
+//					+ profileuri.getAuthority() + profileuri.getPath());
+//			String partypath = partyuri.getPath();
+//			partypath = partypath.substring(0, partypath.lastIndexOf('/'));
+//			PartyWithParameters cobparty = new PartyWithParameters(new PartyRef(
+//					partyuri.getScheme() + "://" + partyuri.getAuthority()
+//							+ partypath + "/" + COB_PARTY),
+//					new Parameters());
+//			return new PartyWithProfile(cobparty, cobprof);
+//
+//		} catch (URISyntaxException e) {
+//			throw new IllegalArgumentException(
+//					"Failed making cob party with profile " + profile, e);
+//		}
+//	}
 
 }
Index: protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/ProfileList.java
===================================================================
--- protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/ProfileList.java	(revision 14)
+++ protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/ProfileList.java	(revision 14)
@@ -0,0 +1,68 @@
+package geniusweb.protocol.tournament.allpermutations;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import geniusweb.references.ProfileRef;
+
+/**
+ * Contains a list of profiles, one for each {@link Team} member.
+ */
+@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
+public class ProfileList {
+	@JsonValue
+	private final List<ProfileRef> profiles; // field to ensure immutability
+
+	/**
+	 * 
+	 * @param ps a list of {@link ProfileRef}s. The length and order is
+	 *           important as each will be matched with the {@link Team} member
+	 *           at the same index.
+	 */
+	@JsonCreator
+	public ProfileList(List<ProfileRef> ps) {
+		this.profiles = new ArrayList<>(ps);
+	}
+
+	public List<ProfileRef> getProfiles() {
+		return Collections.unmodifiableList(profiles);
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result
+				+ ((profiles == null) ? 0 : profiles.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		ProfileList other = (ProfileList) obj;
+		if (profiles == null) {
+			if (other.profiles != null)
+				return false;
+		} else if (!profiles.equals(other.profiles))
+			return false;
+		return true;
+	}
+
+	public String toString() {
+		return profiles.toString();
+	}
+}
Index: protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/Team.java
===================================================================
--- protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/Team.java	(revision 14)
+++ protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/Team.java	(revision 14)
@@ -0,0 +1,74 @@
+package geniusweb.protocol.tournament.allpermutations;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonValue;
+
+import geniusweb.references.PartyWithParameters;
+
+/**
+ * A team is a group of parties, each with their own parameters. Each will be
+ * coupled to a {@link ProfileList} in the generation phase of the protocol
+ *
+ */
+@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
+public class Team {
+	@JsonValue
+	private final List<PartyWithParameters> parties; // ensure immutability
+
+	/**
+	 * 
+	 * @param ps a list of {@link PartyWithParameters}. Each party is always
+	 *           associated with the given parameters. The order of them is
+	 *           important as it will be matched with the order in the
+	 *           {@link ProfileList}.
+	 */
+	@JsonCreator
+	public Team(List<PartyWithParameters> ps) {
+		this.parties = new ArrayList<PartyWithParameters>(ps);
+	}
+
+	/**
+	 * 
+	 * @return list of all team {@link PartyWithParameters}.
+	 */
+	public List<PartyWithParameters> getParties() {
+		return Collections.unmodifiableList(parties);
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((parties == null) ? 0 : parties.hashCode());
+		return result;
+	}
+
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		Team other = (Team) obj;
+		if (parties == null) {
+			if (other.parties != null)
+				return false;
+		} else if (!parties.equals(other.parties))
+			return false;
+		return true;
+	}
+
+	public String toString() {
+		return parties.toString();
+	}
+}
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());
+//	}
 
 }
