Index: protocol/src/test/java/geniusweb/protocol/session/DefaultSessionStateTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/DefaultSessionStateTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/DefaultSessionStateTest.java	(revision 30)
@@ -41,5 +41,5 @@
 	private DefaultSessionState1 state1, state1a, stateA, stateE, stateF;
 	// The 1 is because we are testing an instance, not the abstract class
-	private String state1string = "{\"DefaultSessionState1\":{\"actions\":[],\"progress\":{\"time\":{\"duration\":1000,\"start\":1000}},\"settings\":{\"SAOPSettings\":{\"participants\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"},{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":1000}}}},\"error\":null,\"partyprofiles\":{\"party1\":{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"}}}}";
+	private String state1string = "{\"DefaultSessionState1\":{\"actions\":[],\"progress\":{\"time\":{\"duration\":1000,\"start\":1000}},\"settings\":{\"SAOPSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":1000}}}},\"error\":null,\"partyprofiles\":{\"party1\":{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"}}}}";
 	private ProgressTime progr;
 	private final Date start = new Date(1000l);
@@ -60,7 +60,7 @@
 				new PartyRef("party2"), new Parameters());
 		ProfileRef profile2 = new ProfileRef("profile2");
-		List<OnePartyTeam> participants = Arrays.asList(
-				new OnePartyTeam(party1ref, profile1),
-				new OnePartyTeam(party2ref, profile2));
+		List<TeamInfo> participants = Arrays.asList(
+				new TeamInfo(party1ref, profile1),
+				new TeamInfo(party2ref, profile2));
 		SessionSettings settings = new SAOPSettings(participants, deadline);
 		ProtocolException e = new ProtocolException("test protocol error",
Index: protocol/src/test/java/geniusweb/protocol/session/TeamInfoTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/TeamInfoTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/TeamInfoTest.java	(revision 30)
@@ -0,0 +1,73 @@
+package geniusweb.protocol.session;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.references.Parameters;
+import geniusweb.references.PartyRef;
+import geniusweb.references.PartyWithParameters;
+import geniusweb.references.ProfileRef;
+import tudelft.utilities.junit.GeneralTests;
+
+public class TeamInfoTest extends GeneralTests<TeamInfo> {
+
+	private TeamInfo team1 = new TeamInfo(Collections.emptyList());
+	private TeamInfo team1a = new TeamInfo(Collections.emptyList());
+	private PartyRef partyref;
+	private Parameters parameters = new Parameters();;
+	private ProfileRef profileref;
+	private TeamInfo team2, team2a;
+	private String asString1 = "{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"}]}}";
+
+	@Before
+	public void before() throws URISyntaxException {
+		partyref = new PartyRef("party1");
+		profileref = new ProfileRef("profile1");
+		team2 = new TeamInfo(new PartyWithParameters(partyref, parameters),
+				profileref);
+		team2a = new TeamInfo(new PartyWithParameters(partyref, parameters),
+				profileref);
+
+	}
+
+	@Override
+	public List<List<TeamInfo>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(team1, team1a),
+				Arrays.asList(team2, team2a));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList("TeamInfo.\\[\\].",
+				"TeamInfo.\\[PartyWithProfile.*party1.*profile1.*\\].*");
+	}
+
+	@Test
+	public void testSerialize() throws JsonProcessingException {
+
+		ObjectMapper jackson = new ObjectMapper();
+		System.out.println(jackson.writeValueAsString(team2));
+		assertEquals(asString1, jackson.writeValueAsString(team2));
+
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+
+		ObjectMapper jackson = new ObjectMapper();
+		TeamInfo read = jackson.readValue(asString1, TeamInfo.class);
+		assertEquals(team2, read);
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java	(revision 30)
@@ -19,9 +19,10 @@
 import geniusweb.deadline.DeadlineRounds;
 import geniusweb.deadline.DeadlineTime;
-import geniusweb.protocol.session.OnePartyTeam;
 import geniusweb.protocol.session.SessionSettings;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
 import geniusweb.references.PartyWithParameters;
+import geniusweb.references.PartyWithProfile;
 import geniusweb.references.ProfileRef;
 import tudelft.utilities.junit.GeneralTests;
@@ -30,11 +31,11 @@
 public class AMOPSettingsTest extends GeneralTests<AMOPSettings> {
 
-	private OnePartyTeam partyprof1 = mock(OnePartyTeam.class);
-	private OnePartyTeam partyprof2 = mock(OnePartyTeam.class);
-	private OnePartyTeam partyprof3 = mock(OnePartyTeam.class);
-	private List<OnePartyTeam> participants2 = Arrays.asList(partyprof1,
+	private TeamInfo partyprof1 = mock(TeamInfo.class);
+	private TeamInfo partyprof2 = mock(TeamInfo.class);
+	private TeamInfo partyprof3 = mock(TeamInfo.class);
+	private List<TeamInfo> participants2 = Arrays.asList(partyprof1,
 			partyprof2);
-	private List<OnePartyTeam> participants3 = Arrays.asList(partyprof1,
-			partyprof2, partyprof3);
+	private List<TeamInfo> participants3 = Arrays.asList(partyprof1, partyprof2,
+			partyprof3);
 
 	private DeadlineTime deadline = mock(DeadlineTime.class);
@@ -47,6 +48,7 @@
 
 	private AMOPSettings sersettings;
-	private final String serialized = "{\"AMOPSettings\":{\"participants\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}}}}";
-	private List<OnePartyTeam> participants;
+	private final String serialized = "{\"AMOPSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}}}}";
+	private List<TeamInfo> participants;
+	private PartyWithProfile partywithprof1, partywithprof2;
 
 	@Before
@@ -60,4 +62,6 @@
 		when(partyprof3.toString()).thenReturn("party and profile 3");
 
+		when(partyprof3.getSize()).thenReturn(1);
+
 		// SERIALIZABLE version with REAL objects. Still no workaround for
 		// this...
@@ -68,7 +72,9 @@
 				new PartyRef("http://party2"), new Parameters());
 		ProfileRef profile2 = new ProfileRef("http://profile2");
-		OnePartyTeam partywithprof1 = new OnePartyTeam(party1, profile1);
-		OnePartyTeam partywithprof2 = new OnePartyTeam(party2, profile2);
-		participants = Arrays.asList(partywithprof1, partywithprof2);
+		partywithprof1 = new PartyWithProfile(party1, profile1);
+		partywithprof2 = new PartyWithProfile(party2, profile2);
+		participants = Arrays.asList(
+				new TeamInfo(Arrays.asList(partywithprof1)),
+				new TeamInfo(Arrays.asList(partywithprof2)));
 
 		Deadline deadlinetime = new DeadlineTime(100);
@@ -145,5 +151,6 @@
 	@Test
 	public void testGetAllParties() {
-		assertEquals(participants, sersettings.getAllParties());
+		assertEquals(Arrays.asList(partywithprof1, partywithprof2),
+				sersettings.getAllParties());
 	}
 
Index: protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACSettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACSettingsTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACSettingsTest.java	(revision 30)
@@ -19,9 +19,10 @@
 import geniusweb.deadline.DeadlineRounds;
 import geniusweb.deadline.DeadlineTime;
-import geniusweb.protocol.session.OnePartyTeam;
 import geniusweb.protocol.session.SessionSettings;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
 import geniusweb.references.PartyWithParameters;
+import geniusweb.references.PartyWithProfile;
 import geniusweb.references.ProfileRef;
 import geniusweb.voting.VotingEvaluator;
@@ -34,11 +35,11 @@
 	private final ObjectMapper jackson = new ObjectMapper();
 	private final Parameters noparams = new Parameters();
-	private OnePartyTeam partyprof1 = mockParty("party1", noparams);
-	private OnePartyTeam partyprof2 = mockParty("party2", noparams);
-	private OnePartyTeam partyprof3 = mockParty("party3", noparams);
-	private List<OnePartyTeam> participants2 = Arrays.asList(partyprof1,
+	private TeamInfo partyprof1 = mockParty("party1", noparams);
+	private TeamInfo partyprof2 = mockParty("party2", noparams);
+	private TeamInfo partyprof3 = mockParty("party3", noparams);
+	private List<TeamInfo> participants2 = Arrays.asList(partyprof1,
 			partyprof2);
-	private List<OnePartyTeam> participants3 = Arrays.asList(partyprof1,
-			partyprof2, partyprof3);
+	private List<TeamInfo> participants3 = Arrays.asList(partyprof1, partyprof2,
+			partyprof3);
 
 	private final VotingEvaluator ve = new LargestAgreement();
@@ -56,11 +57,15 @@
 
 	private MOPACSettings sersettings;
-	private final String serialized = "{\"MOPACSettings\":{\"participants\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}}";
-	private List<OnePartyTeam> participants;
+	private final String serialized = "{\"MOPACSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}}";
+	private List<TeamInfo> participants;
+	private PartyWithProfile partywithprof1;
+	private PartyWithProfile partywithprof2;
 
-	private OnePartyTeam mockParty(String partyname, Parameters params) {
-		OnePartyTeam team = mock(OnePartyTeam.class);
+	private TeamInfo mockParty(String partyname, Parameters params) {
+		TeamInfo team = mock(TeamInfo.class);
+		when(team.getSize()).thenReturn(1);
 		PartyWithParameters pwithp = mock(PartyWithParameters.class);
-		when(team.getParty()).thenReturn(pwithp);
+		when(team.getAllParties()).thenReturn(Arrays
+				.asList(new PartyWithProfile(pwithp, mock(ProfileRef.class))));
 		when(team.toString()).thenReturn(partyname);
 		when(pwithp.toString()).thenReturn(partyname);
@@ -84,7 +89,9 @@
 				new PartyRef("http://party2"), new Parameters());
 		ProfileRef profile2 = new ProfileRef("http://profile2");
-		OnePartyTeam partywithprof1 = new OnePartyTeam(party1, profile1);
-		OnePartyTeam partywithprof2 = new OnePartyTeam(party2, profile2);
-		participants = Arrays.asList(partywithprof1, partywithprof2);
+		partywithprof1 = new PartyWithProfile(party1, profile1);
+		partywithprof2 = new PartyWithProfile(party2, profile2);
+		participants = Arrays.asList(
+				new TeamInfo(Arrays.asList(partywithprof1)),
+				new TeamInfo(Arrays.asList(partywithprof2)));
 
 		Deadline deadlinetime = new DeadlineTime(100);
@@ -160,5 +167,6 @@
 	@Test
 	public void testGetAllParties() {
-		assertEquals(participants, sersettings.getAllParties());
+		assertEquals(Arrays.asList(partywithprof1, partywithprof2),
+				sersettings.getAllParties());
 	}
 
Index: protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java	(revision 30)
@@ -31,5 +31,5 @@
 import geniusweb.progress.ProgressTime;
 import geniusweb.protocol.ProtocolException;
-import geniusweb.protocol.session.OnePartyTeam;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.protocol.session.mopac.phase.OfferPhase;
 import geniusweb.protocol.session.mopac.phase.Phase;
@@ -60,5 +60,7 @@
 			mock(ProfileRef.class));
 
-	private final String mopacsettingstr = "{\"MOPACSettings\":{\"participants\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}}";
+	// copy from MopacSettingsTest. We need settings here but don't want to mock
+	// this large structure.
+	private final String mopacsettingstr = "{\"MOPACSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}}";
 	// create real objects for the GeneralTests and for serialization tests
 	private PartyStates partyStates = new PartyStates(Collections.emptyMap());
@@ -72,5 +74,5 @@
 	private MOPACState state1, state1a, state2, state3, state4, state5, state6;
 
-	private String serialized = "{\"MOPACState\":{\"phase\":{\"OfferPhase\":{\"partyStates\":{\"notYetActed\":[],\"actions\":[],\"agreements\":{},\"walkedAway\":[],\"exceptions\":{},\"powers\":{}},\"evaluator\":{\"LargestAgreement\":{}},\"deadline\":100}},\"actions\":[],\"progress\":{\"time\":{\"duration\":100,\"start\":1001}},\"settings\":{\"MOPACSettings\":{\"participants\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}},\"partyprofiles\":{}}}";
+	private String serialized = "{\"MOPACState\":{\"phase\":{\"OfferPhase\":{\"partyStates\":{\"notYetActed\":[],\"actions\":[],\"agreements\":{},\"walkedAway\":[],\"exceptions\":{},\"powers\":{}},\"evaluator\":{\"LargestAgreement\":{}},\"deadline\":100}},\"actions\":[],\"progress\":{\"time\":{\"duration\":100,\"start\":1001}},\"settings\":{\"MOPACSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}},\"partyprofiles\":{}}}";
 
 	@Before
@@ -82,8 +84,10 @@
 		MOPACSettings realsettings = jackson.readValue(mopacsettingstr,
 				MOPACSettings.class);
-		OnePartyTeam party = mock(OnePartyTeam.class);
+		TeamInfo party = mock(TeamInfo.class);
 		PartyWithParameters pwithp = mock(PartyWithParameters.class);
 		when(pwithp.getParameters()).thenReturn(new Parameters());
-		when(party.getParty()).thenReturn(pwithp);
+		when(party.getAllParties()).thenReturn(Arrays
+				.asList(new PartyWithProfile(pwithp, mock(ProfileRef.class))));
+		when(party.getSize()).thenReturn(1);
 		MOPACSettings realsettings2 = realsettings.with(party);
 
Index: protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java	(revision 30)
@@ -47,7 +47,7 @@
 	// makes the test unreadable.
 	private final String setstr = "{\"MOPACSettings\":{\"participants\":["
-			+ "{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},"
-			+ "{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"},"
-			+ "{\"party\":{\"partyref\":\"http://party3\",\"parameters\":{}},\"profile\":\"http://profile3\"}],"
+			+ "{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},"
+			+ "{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}},"
+			+ "{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party3\",\"parameters\":{}},\"profile\":\"http://profile3\"}]}}],"
 			+ "\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreement\":{}}}}";
 
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2SettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2SettingsTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2SettingsTest.java	(revision 30)
@@ -0,0 +1,173 @@
+package geniusweb.protocol.session.mopac2;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.deadline.Deadline;
+import geniusweb.deadline.DeadlineRounds;
+import geniusweb.deadline.DeadlineTime;
+import geniusweb.protocol.session.SessionSettings;
+import geniusweb.protocol.session.TeamInfo;
+import geniusweb.references.Parameters;
+import geniusweb.references.PartyRef;
+import geniusweb.references.PartyWithParameters;
+import geniusweb.references.PartyWithProfile;
+import geniusweb.references.ProfileRef;
+import geniusweb.voting.VotingEvaluatorWithValue;
+import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
+import tudelft.utilities.junit.GeneralTests;
+import tudelft.utilities.logging.ReportToLogger;
+
+public class MOPAC2SettingsTest extends GeneralTests<MOPAC2Settings> {
+
+	private final ObjectMapper jackson = new ObjectMapper();
+	private final Parameters noparams = new Parameters();
+	private TeamInfo partyprof1 = mockParty("party1", noparams);
+	private TeamInfo partyprof2 = mockParty("party2", noparams);
+	private TeamInfo partyprof3 = mockParty("party3", noparams);
+	private List<TeamInfo> participants2 = Arrays.asList(partyprof1,
+			partyprof2);
+	private List<TeamInfo> participants3 = Arrays.asList(partyprof1, partyprof2,
+			partyprof3);
+
+	private final VotingEvaluatorWithValue ve = new LargestAgreementWithValue();
+
+	private DeadlineTime deadline = mock(DeadlineTime.class);
+	private Deadline deadline2 = mock(Deadline.class);
+	private MOPAC2Settings settings1 = new MOPAC2Settings(participants2,
+			deadline, ve);
+	private MOPAC2Settings settings1a = new MOPAC2Settings(participants2,
+			deadline, ve);
+	private MOPAC2Settings settings2 = new MOPAC2Settings(participants3,
+			deadline, ve);
+	private MOPAC2Settings settings3 = new MOPAC2Settings(participants2,
+			deadline2, ve);
+
+	private MOPAC2Settings sersettings;
+	private final String serialized = "{\"MOPAC2Settings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreementWithValue\":{}}}}";
+	private List<TeamInfo> participants;
+	private PartyWithProfile partywithprof1, partywithprof2;
+
+	private TeamInfo mockParty(String partyname, Parameters params) {
+		TeamInfo team = mock(TeamInfo.class);
+		when(team.getSize()).thenReturn(1);
+		PartyWithParameters pwithp = mock(PartyWithParameters.class);
+		when(team.getAllParties()).thenReturn(Arrays
+				.asList(new PartyWithProfile(pwithp, mock(ProfileRef.class))));
+		when(team.toString()).thenReturn(partyname);
+		when(pwithp.toString()).thenReturn(partyname);
+		when(pwithp.getParameters()).thenReturn(params);
+		return team;
+	}
+
+	@Before
+	public void before() throws URISyntaxException {
+
+		when(deadline.getDuration()).thenReturn(1000l);
+		when(deadline.toString()).thenReturn("deadline");
+		when(deadline2.toString()).thenReturn("deadline2");
+
+		// SERIALIZABLE version with REAL objects. Still no workaround for
+		// this...
+		PartyWithParameters party1 = new PartyWithParameters(
+				new PartyRef("http://party1"), new Parameters());
+		ProfileRef profile1 = new ProfileRef("http://profile1");
+		PartyWithParameters party2 = new PartyWithParameters(
+				new PartyRef("http://party2"), new Parameters());
+		ProfileRef profile2 = new ProfileRef("http://profile2");
+		partywithprof1 = new PartyWithProfile(party1, profile1);
+		partywithprof2 = new PartyWithProfile(party2, profile2);
+		participants = Arrays.asList(
+				new TeamInfo(Arrays.asList(partywithprof1)),
+				new TeamInfo(Arrays.asList(partywithprof2)));
+
+		Deadline deadlinetime = new DeadlineTime(100);
+		sersettings = new MOPAC2Settings(participants, deadlinetime, ve);
+
+	}
+
+	@Override
+	public List<List<MOPAC2Settings>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(settings1, settings1a),
+				Arrays.asList(settings2), Arrays.asList(settings3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"MOPAC2Settings.*party1.*party2.*deadline.*LargestAgreement.*",
+				"MOPAC2Settings.*party1.*party2.*deadline.*LargestAgreement.*",
+				"MOPAC2Settings.*party1.*party2.*deadline2.*LargestAgreement.*");
+	}
+
+	@Test
+	public void getProtocolTest() {
+		assertEquals("MOPAC2", settings1.getProtocol(new ReportToLogger("test"))
+				.getRef().getURI().toString());
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void constructorNoDeadlineTest() {
+		new MOPAC2Settings(participants2, null, ve);
+	}
+
+	@Test
+	public void testMaxRuntime() {
+		when(deadline.getDuration()).thenReturn(234l);
+		assertEquals((Double) .234d, settings1.getMaxRunTime());
+	}
+
+	@Test
+	public void testMaxRuntimeRounds() {
+		deadline = mock(DeadlineRounds.class);
+		when(deadline.getDuration()).thenReturn(12000l);
+
+		MOPAC2Settings settings = new MOPAC2Settings(participants2, deadline,
+				ve);
+
+		assertEquals((Double) 12d, settings.getMaxRunTime());
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+		SessionSettings obj = jackson.readValue(serialized,
+				SessionSettings.class);
+		System.out.println(obj);
+		assertEquals(sersettings, obj);
+	}
+
+	@Test
+	public void testSerialize()
+			throws JsonProcessingException, URISyntaxException {
+
+		String string = jackson.writeValueAsString(sersettings);
+		System.out.println(string);
+		assertEquals(serialized, string);
+	}
+
+	@Test
+	public void testWith() {
+		MOPAC2Settings saop = new MOPAC2Settings(participants2, deadline, ve);
+		SessionSettings saop2 = saop.with(partyprof3);
+		assertEquals(3, saop2.getTeams().size());
+	}
+
+	@Test
+	public void testGetAllParties() {
+		assertEquals(Arrays.asList(partywithprof1, partywithprof2),
+				sersettings.getAllParties());
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2StateTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2StateTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2StateTest.java	(revision 30)
@@ -0,0 +1,284 @@
+package geniusweb.protocol.session.mopac2;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Action;
+import geniusweb.actions.PartyId;
+import geniusweb.progress.Progress;
+import geniusweb.progress.ProgressTime;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.TeamInfo;
+import geniusweb.protocol.session.mopac2.phase.OfferPhase;
+import geniusweb.protocol.session.mopac2.phase.Phase;
+import geniusweb.references.Parameters;
+import geniusweb.references.PartyWithParameters;
+import geniusweb.references.PartyWithProfile;
+import geniusweb.references.ProfileRef;
+import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
+import tudelft.utilities.junit.GeneralTests;
+
+public class MOPAC2StateTest extends GeneralTests<MOPAC2State> {
+	private static final Date NOW = new Date(1001);
+
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private final MOPAC2Settings settings = mock(MOPAC2Settings.class);
+
+	private final MOPAC2State state = new MOPAC2State(settings);
+
+	private PartyId PARTY1 = new PartyId("party1");
+	private PartyId PARTY2 = new PartyId("party2");
+	private PartyId PARTY3 = new PartyId("party3");
+
+	private PartyWithParameters partyparams1 = mock(PartyWithParameters.class);
+	private Parameters params1 = new Parameters();
+
+	private PartyWithProfile profile1 = new PartyWithProfile(partyparams1,
+			mock(ProfileRef.class));
+
+	// settings is copy from the MOPAC2Settings string. Shortcut to creating
+	// this all manually.
+	private final String mopacsettingstr = "{\"MOPAC2Settings\":"
+			+ "{\"participants\":["
+			+ "{\"TeamInfo\":{\"parties\":[ {\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"} ]}},"
+			+ "{\"TeamInfo\":{\"parties\":[ {\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"} ]}}  ],"
+			+ "\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreementWithValue\":{}}}}";;
+	// create real objects for the GeneralTests and for serialization tests
+	private PartyStates partyStates = new PartyStates(Collections.emptyMap());
+	private Phase phase1 = new OfferPhase(partyStates, 100l,
+			new LargestAgreementWithValue());
+	private Phase phase2 = new OfferPhase(partyStates, 200l,
+			new LargestAgreementWithValue());
+	private Progress progress1 = new ProgressTime(100l, NOW);
+	private Progress progress2 = new ProgressTime(200l, NOW);
+
+	private MOPAC2State state1, state1a, state2, state3, state4, state5, state6;
+
+	private String serialized = "{\"MOPAC2State\":{\"phase\":{\"OfferPhase\":{\"partyStates\":{\"notYetActed\":[],\"actions\":[],\"agreements\":{},\"walkedAway\":[],\"exceptions\":{},\"powers\":{}},\"evaluator\":{\"LargestAgreementWithValue\":{}},\"deadline\":100}},\"actions\":[],\"progress\":{\"time\":{\"duration\":100,\"start\":1001}},\"settings\":{\"MOPAC2Settings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreementWithValue\":{}}}},\"partyprofiles\":{}}}";
+
+	@Before
+	public void before()
+			throws JsonParseException, JsonMappingException, IOException {
+		params1.put("power", 2);
+		when(partyparams1.getParameters()).thenReturn(params1);
+
+		MOPAC2Settings realsettings = jackson.readValue(mopacsettingstr,
+				MOPAC2Settings.class);
+		TeamInfo party = mock(TeamInfo.class);
+		PartyWithParameters pwithp = mock(PartyWithParameters.class);
+		when(pwithp.getParameters()).thenReturn(new Parameters());
+		when(party.getAllParties()).thenReturn(Arrays
+				.asList(new PartyWithProfile(pwithp, mock(ProfileRef.class))));
+		when(party.getSize()).thenReturn(1);
+		MOPAC2Settings realsettings2 = realsettings.with(party);
+
+		state1 = new MOPAC2State(phase1, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state1a = new MOPAC2State(phase1, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state2 = new MOPAC2State(phase2, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state3 = new MOPAC2State(phase1, Arrays.asList(mock(Action.class)),
+				progress1, realsettings, Collections.emptyMap());
+		state4 = new MOPAC2State(phase1, Collections.emptyList(), progress2,
+				realsettings, Collections.emptyMap());
+		state5 = new MOPAC2State(phase1, Collections.emptyList(), progress1,
+				realsettings2, Collections.emptyMap());
+		state6 = new MOPAC2State(phase1, Collections.emptyList(), progress1,
+				realsettings,
+				Collections.singletonMap(PARTY1, mock(PartyWithProfile.class)));
+
+	}
+
+	@Override
+	public List<List<MOPAC2State>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(state1, state1a),
+				Arrays.asList(state2), Arrays.asList(state3),
+				Arrays.asList(state4), Arrays.asList(state5),
+				Arrays.asList(state6));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*",
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*",
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*",
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*",
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*",
+				"MOPAC2State.*OfferPhase.*PartyStates.*,MOPAC2Settings.*PartyWithProfile.*ProgressTime.*");
+	}
+
+	@Test
+	public void smokeTest() {
+	}
+
+	@Test
+	public void addProfilesBeforeInit() {
+		MOPAC2State st = state.with(PARTY1, profile1);
+		assertTrue(st.getPartyProfiles().containsKey(PARTY1));
+	}
+
+	@Test
+	public void testInit() {
+		// no parties were added, should throw? Go to final mode?
+		// Notice that it's possible to create settings with 0 participants,
+		// because this is needed for Tournament mechanism.
+		MOPAC2State state1 = state
+				.initPhase(new ProgressTime(100l, new Date(0)), 1);
+		assertTrue(state1.getActions().isEmpty());
+		assertTrue(state1.getAgreements().getMap().isEmpty());
+		assertTrue(state1.getPartyProfiles().isEmpty());
+		Phase phase1 = state1.getPhase();
+		assertTrue(phase1 instanceof OfferPhase);
+		OfferPhase offer1 = (OfferPhase) phase1;
+		assertEquals(new PartyStates(Collections.emptyMap()),
+				offer1.getPartyStates());
+	}
+
+	@Test
+	public void getAgreementsTest() {
+		MOPAC2State st = state.initPhase(new ProgressTime(100l, new Date(0)),
+				1);
+		assertTrue(st.getAgreements().getMap().isEmpty());
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+		MOPAC2State obj = jackson.readValue(serialized, MOPAC2State.class);
+		System.out.println(obj);
+		assertEquals(state1, obj);
+	}
+
+	@Test
+	public void testSerialize()
+			throws JsonProcessingException, URISyntaxException {
+
+		String string = jackson.writeValueAsString(state1);
+		System.out.println(string);
+		assertEquals(serialized, string);
+	}
+
+	@Test
+	public void testNewPhasePossible() {
+
+		Phase phase = mock(Phase.class);
+		List<Action> actions = Collections.emptyList();
+		Progress progress = mock(Progress.class);
+		when(progress.getTerminationTime())
+				.thenReturn(new Date(Phase.PHASE_MAXTIME)); // plenty for new
+															// phase
+		Map<PartyId, PartyWithProfile> partyprofiles = mock(Map.class);
+		MOPAC2State s1 = new MOPAC2State(phase, actions, progress, settings,
+				partyprofiles);
+
+		PartyStates states = mock(PartyStates.class);
+		when(phase.getPartyStates()).thenReturn(states);
+		when(states.getNegotiatingParties())
+				.thenReturn(new HashSet<>(Arrays.asList(PARTY1, PARTY2)));
+		assertTrue(s1.isNewPhasePossible(10));
+	}
+
+	@Test
+	public void testNewPhasePossibleOnly1Party() {
+
+		Phase phase = mock(Phase.class);
+		List<Action> actions = Collections.emptyList();
+		Progress progress = mock(Progress.class);
+		when(progress.getTerminationTime())
+				.thenReturn(new Date(Phase.PHASE_MAXTIME)); // plenty for new
+															// phase
+		Map<PartyId, PartyWithProfile> partyprofiles = mock(Map.class);
+		MOPAC2State s1 = new MOPAC2State(phase, actions, progress, settings,
+				partyprofiles);
+
+		PartyStates states = mock(PartyStates.class);
+		when(phase.getPartyStates()).thenReturn(states);
+		when(states.getNegotiatingParties())
+				.thenReturn(new HashSet<>(Arrays.asList(PARTY1)));
+		assertFalse(s1.isNewPhasePossible(10));
+	}
+
+	@Test
+	public void testNewPhasePossibleNotEnoughTime() {
+
+		Phase phase = mock(Phase.class);
+		List<Action> actions = Collections.emptyList();
+		Progress progress = mock(Progress.class);
+		when(progress.getTerminationTime())
+				.thenReturn(new Date(Phase.PHASE_MINTIME - 10));
+		Map<PartyId, PartyWithProfile> partyprofiles = mock(Map.class);
+		MOPAC2State s1 = new MOPAC2State(phase, actions, progress, settings,
+				partyprofiles);
+
+		PartyStates states = mock(PartyStates.class);
+		when(phase.getPartyStates()).thenReturn(states);
+		when(states.getNegotiatingParties())
+				.thenReturn(new HashSet<>(Arrays.asList(PARTY1)));
+		assertFalse(s1.isNewPhasePossible(10));
+	}
+
+	@Test
+	public void nextPhaseTest() {
+		long NOW = 102;
+		Phase phase = mock(Phase.class);
+		List<Action> actions = Collections.emptyList();
+		Progress progress = mock(Progress.class);
+		when(progress.getTerminationTime())
+				.thenReturn(new Date(Phase.PHASE_MAXTIME));
+		Map<PartyId, PartyWithProfile> partyprofiles = mock(Map.class);
+		MOPAC2State s1 = new MOPAC2State(phase, actions, progress, settings,
+				partyprofiles);
+
+		// PhaseB is the next phase, with remaining time
+		Phase phaseB = mock(Phase.class);
+		when(phase.next(eq(NOW), eq(Phase.PHASE_MAXTIME - NOW)))
+				.thenReturn(phaseB);
+
+		MOPAC2State s2 = s1.nextPhase(NOW);
+		assertEquals(phaseB, s2.getPhase());
+	}
+
+	@Test
+	public void exceptionTest() {
+		Phase phase = mock(Phase.class);
+		List<Action> actions = Collections.emptyList();
+		Progress progress = mock(Progress.class);
+		Map<PartyId, PartyWithProfile> partyprofiles = mock(Map.class);
+		MOPAC2State s1 = new MOPAC2State(phase, actions, progress, settings,
+				partyprofiles);
+
+		Phase exphase = mock(Phase.class); // supposed phase that contains the
+											// exception
+		when(phase.with(any(ProtocolException.class))).thenReturn(exphase);
+
+		MOPAC2State errstate = s1.with(new ProtocolException("test", PARTY1));
+		assertEquals(exphase, errstate.getPhase());
+		assertEquals(progress, errstate.getProgress());
+
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2Test.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2Test.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/MOPAC2Test.java	(revision 30)
@@ -0,0 +1,218 @@
+package geniusweb.protocol.session.mopac2;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyLong;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Action;
+import geniusweb.actions.Offer;
+import geniusweb.actions.PartyId;
+import geniusweb.inform.Inform;
+import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
+import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
+import geniusweb.protocol.session.mopac2.phase.OfferPhase;
+import geniusweb.protocol.session.mopac2.phase.Phase;
+import geniusweb.protocol.session.mopac2.phase.VotingPhase;
+import tudelft.utilities.logging.Reporter;
+import tudelft.utilities.repository.NoResourcesNowException;
+
+public class MOPAC2Test {
+
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final PartyId PARTY1ID = new PartyId("party1");
+	private static final PartyId PARTY2ID = new PartyId("party2");
+	private static final PartyId PARTY3ID = new PartyId("party3");
+
+	// don't try to mock settings, all parts are needed and mocking
+	// makes the test unreadable.
+	// notice, 3 parties, this differs from MopacSettingsTest output.
+	private final String setstr = "{\"MOPAC2Settings\":{\"participants\":["
+			+ "{\"TeamInfo\":{\"parties\":[  {\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"} ]}},"
+			+ "{\"TeamInfo\":{\"parties\":[ {\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}},"
+			+ "{\"TeamInfo\":{\"parties\":[ {\"party\":{\"partyref\":\"http://party3\",\"parameters\":{}},\"profile\":\"http://profile3\"} ]}}  ],"
+			+ "\"deadline\":{\"deadlinetime\":{\"durationms\":100}},\"votingevaluator\":{\"LargestAgreementWithValue\":{}}}}";
+
+	// {"MOPAC2Settings":{"participants":[{"TeamInfo":{"parties":[{"party":{"partyref":"http://party1","parameters":{}},"profile":"http://profile1"}]}},{"TeamInfo":{"parties":[{"party":{"partyref":"http://party2","parameters":{}},"profile":"http://profile2"}]}}],"deadline":{"deadlinetime":{"durationms":100}},"votingevaluator":{"LargestAgreementWithValue":{}}}}
+
+	private MOPAC2Settings settings;
+	private Reporter logger = mock(Reporter.class);
+	private MOPAC2 mopac;
+
+	private final ProtocolToPartyConnFactory factory = mock(
+			ProtocolToPartyConnFactory.class);
+	private final ProtocolToPartyConn conn1 = mock(ProtocolToPartyConn.class),
+			conn2 = mock(ProtocolToPartyConn.class),
+			conn3 = mock(ProtocolToPartyConn.class);
+
+	private List<ProtocolToPartyConn> connections;
+
+	@Before
+	public void before() throws JsonParseException, JsonMappingException,
+			IOException, NoResourcesNowException {
+		settings = jackson.readValue(setstr, MOPAC2Settings.class);
+		mopac = settings.getProtocol(logger);
+
+		connections = Arrays.asList(conn1, conn2, conn3);
+		when(factory.connect(any(List.class))).thenReturn(connections);
+
+		// hack the state.with(connection) stuff simplistically
+
+		when(conn1.getParty()).thenReturn(PARTY1ID);
+		when(conn2.getParty()).thenReturn(PARTY2ID);
+		when(conn3.getParty()).thenReturn(PARTY3ID);
+	}
+
+	@Test
+	public void testSmoke() {
+	}
+
+	@Test
+	public void testGetDescr() {
+		assertNotNull(mopac.getDescription());
+	}
+
+	@Test
+	public void testInitialState() {
+		MOPAC2State state = mopac.getState();
+		assertEquals(settings, state.getSettings());
+		assertTrue(state.getActions().isEmpty());
+	}
+
+	@Test
+	public void testProtocol() {
+		assertEquals("MOPAC2", mopac.getRef().getURI().getPath());
+	}
+
+	@Test
+	public void testWorkingCheckDeadline()
+			throws IOException, NoResourcesNowException, InterruptedException {
+
+		mopac.start(factory);
+
+		assertFalse(mopac.getState().isFinal(System.currentTimeMillis()));
+		// we have deadline in 100ms so check
+		Thread.sleep(200);
+		assertTrue(mopac.getState().isFinal(System.currentTimeMillis()));
+	}
+
+	@Test
+	public void testSubscribedToConnections() {
+		mopac.start(factory);
+		verify(conn1, times(1)).addListener(any());
+		verify(conn2, times(1)).addListener(any());
+		verify(conn3, times(1)).addListener(any());
+	}
+
+	@Test
+	public void testActionIsBroadcast()
+			throws IOException, NoResourcesNowException, InterruptedException {
+
+		mopac.start(factory);
+		Action offer = mock(Offer.class);
+		mopac.actionRequest(conn1, offer, 1l);
+
+		// 1 time for YourTurn, one time for ActionDone.
+		// but filtering ActionDone here (instead of Action) does not work,
+		// maybe bug in Mockito?
+		verify(conn1, times(2)).send(any(Inform.class));
+	}
+
+	/**
+	 * Fatal error occurs, run should fail
+	 */
+	@Test(expected = RuntimeException.class)
+	public void testPartyFailsConnect()
+			throws IOException, NoResourcesNowException {
+		ProtocolToPartyConnFactory factory1 = mock(
+				ProtocolToPartyConnFactory.class);
+		// irrecoverable fail test
+		when(factory1.connect(any(List.class)))
+				.thenThrow(new IOException("Failed to connect to parties"));
+
+		mopac.start(factory1);
+
+	}
+
+	/**
+	 * Nonfatal error occurs, protocol should retry till success
+	 */
+	@Test
+	public void testPartyFailsConnect2ndtimeOK()
+			throws IOException, NoResourcesNowException {
+		long now = System.currentTimeMillis();
+		ProtocolToPartyConnFactory factory1 = mock(
+				ProtocolToPartyConnFactory.class);
+		// recoverable fail, and then success.
+		when(factory1.connect(any(List.class)))
+				.thenThrow(new NoResourcesNowException("try again later",
+						new Date(now + 100)))
+				.thenReturn(connections);
+
+		mopac.start(factory1);
+
+	}
+
+	/**
+	 * Test that in Offer phase, and party does action, the next phase is
+	 * entered.
+	 */
+	@Test
+	public void testProceedsNextPhase() {
+		// the state before the last party makes the offer
+		MOPAC2State offerstate = mock(MOPAC2State.class);
+		when(offerstate.getSettings()).thenReturn(settings);
+		OfferPhase offerphase = mock(OfferPhase.class);
+		when(offerphase.isFinal(anyLong())).thenReturn(false);
+		when(offerstate.getPhase()).thenReturn(offerphase);
+
+		// the phase where all parties placed an offer
+		OfferPhase finalofferphase = mock(OfferPhase.class);
+		when(finalofferphase.isFinal(anyLong())).thenReturn(true);
+		MOPAC2State finalofferstate = mock(MOPAC2State.class);
+		when(finalofferstate.getPhase()).thenReturn(finalofferphase);
+		when(finalofferstate.finishPhase()).thenReturn(finalofferstate);
+
+		when(offerstate.with(any(PartyId.class), any(Action.class), anyLong()))
+				.thenReturn(finalofferstate);
+
+		// the phase where all parties can start voting.
+		// this is the state to be reached.
+		long now = System.currentTimeMillis();
+		MOPAC2State votingstate = mock(MOPAC2State.class);
+		Phase votingphase = mock(VotingPhase.class);
+		PartyStates votingpartystates = mock(PartyStates.class);
+		when(votingphase.getDeadline()).thenReturn(now + 100);
+		when(votingphase.getPartyStates()).thenReturn(votingpartystates);
+		when(votingstate.getPhase()).thenReturn(votingphase);
+
+		when(finalofferstate.nextPhase(anyLong())).thenReturn(votingstate);
+
+		mopac = new MOPAC2(offerstate, logger);
+		Offer action = mock(Offer.class);
+		mopac.actionRequest(conn3, action, now);
+
+		// check that the action result in reaching the voting phase
+		assertEquals(votingstate, mopac.getState());
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/PartyStatesTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/PartyStatesTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/PartyStatesTest.java	(revision 30)
@@ -0,0 +1,112 @@
+package geniusweb.protocol.session.mopac2;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.PartyId;
+import geniusweb.inform.Agreements;
+import geniusweb.protocol.ProtocolException;
+import tudelft.utilities.junit.GeneralTests;
+
+public class PartyStatesTest extends GeneralTests<PartyStates> {
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private final PartyId party1 = new PartyId("party1");
+	private final PartyId party2 = new PartyId("party2");
+	private final PartyId party3 = new PartyId("party3");
+
+	private final Map<PartyId, Integer> powers = new HashMap<>();
+	private final PartyStates states1, states1a, states2;
+	private final String serialized = "{\"notYetActed\":[\"party2\",\"party1\",\"party3\"],\"actions\":[],\"agreements\":{},\"walkedAway\":[],\"exceptions\":{},\"powers\":{\"party2\":3,\"party1\":2,\"party3\":3}}";
+
+	public PartyStatesTest() {
+
+		// FIXME use the other constructor to really test this.
+//		PartyStates(Set<PartyId> notYetActed, List<Action> actions,
+//				Agreements agreements, List<PartyId> walkedAway,
+//				Map<PartyId, ProtocolException> exceptions,
+//				Map<PartyId, Integer> powers)
+//		
+		powers.put(party1, 2);
+		powers.put(party2, 3);
+		states2 = new PartyStates(powers);
+		powers.put(party3, 3);
+		states1 = new PartyStates(powers);
+		states1a = new PartyStates(powers);
+	}
+
+	@Override
+	public List<List<PartyStates>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(states1, states1a),
+				Arrays.asList(states2));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"PartyStates.*\\[party2, party1, party3\\],\\[\\],Agreements\\{\\},\\[\\],\\{\\}.*",
+				"PartyStates.*\\[party2, party1\\],\\[\\],Agreements\\{\\},\\[\\],\\{\\}.*");
+	}
+
+	@Test
+	public void testBasics() {
+		assertEquals(powers.keySet(), states1.getNegotiatingParties());
+		assertEquals(powers.keySet(), states1.getNotYetActed());
+		assertEquals(0, states1.getExceptions().size());
+	}
+
+	@Test
+	public void testException() {
+		PartyStates newstates = states1
+				.with(new ProtocolException("bla", party1));
+		assertEquals(new Agreements(), newstates.getAgreements());
+		assertEquals(powers.keySet(), states1.getNegotiatingParties());
+		assertEquals(new HashSet<>(Arrays.asList(party2, party3)),
+				newstates.getNotYetActed());
+	}
+
+	@Test
+	public void testFinish() {
+		PartyStates newstates = states1.finish();
+		assertEquals(new Agreements(), newstates.getAgreements());
+		assertEquals(powers.keySet(), states1.getNegotiatingParties());
+		assertEquals(Collections.emptySet(), newstates.getNotYetActed());
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+		PartyStates obj = jackson.readValue(serialized, PartyStates.class);
+		System.out.println(obj);
+		assertEquals(states1, obj);
+	}
+
+	@Test
+	public void testSerialize()
+			throws JsonProcessingException, URISyntaxException {
+
+		String string = jackson.writeValueAsString(states1);
+		System.out.println(string);
+		assertEquals(serialized, string);
+	}
+
+	@Test
+	public void testWalkAway() {
+		PartyStates walkawaystate = states1.withWalkAway(party2);
+		assertEquals(new HashSet<>(Arrays.asList(party1, party3)),
+				walkawaystate.getNotYetActed());
+		assertEquals(Arrays.asList(party2), walkawaystate.getWalkedAway());
+	}
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OfferPhaseTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OfferPhaseTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OfferPhaseTest.java	(revision 30)
@@ -0,0 +1,272 @@
+package geniusweb.protocol.session.mopac2.phase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import geniusweb.actions.Accept;
+import geniusweb.actions.EndNegotiation;
+import geniusweb.actions.Offer;
+import geniusweb.actions.PartyId;
+import geniusweb.actions.Votes;
+import geniusweb.inform.YourTurn;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.mopac2.PartyStates;
+import geniusweb.voting.VotingEvaluatorWithValue;
+import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
+import tudelft.utilities.junit.GeneralTests;
+
+/**
+ * We also test defaultPhase here.
+ */
+public class OfferPhaseTest extends GeneralTests<OfferPhase> {
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private static final long DEADLINE = 10l;
+	private final PartyId party1 = new PartyId("party1");
+	private final PartyId party2 = new PartyId("party2");
+	private final PartyId party3 = new PartyId("party3");
+
+	private final Map<PartyId, Integer> powers = new HashMap<>();
+	private final PartyStates states, states2;
+	private final VotingEvaluatorWithValue evaluator = new LargestAgreementWithValue();
+	private final OfferPhase phase, phase1, phase1a, phase2, phase3;
+
+	// just a test bid
+	private final Bid bid = new Bid("issue", new DiscreteValue("yes"));
+	private final Offer offer = new Offer(party1, bid);
+
+	private final String serialized = "{\"OfferPhase\":{\"partyStates\":{\"notYetActed\":[\"party2\",\"party1\",\"party3\"],\"actions\":[],\"agreements\":{},\"walkedAway\":[],\"exceptions\":{},\"powers\":{\"party2\":3,\"party1\":2,\"party3\":3}},\"evaluator\":{\"LargestAgreementWithValue\":{}},\"deadline\":10}}";
+
+	public OfferPhaseTest() {
+		powers.put(party1, 2);
+		powers.put(party2, 3);
+		states2 = new PartyStates(powers);
+		powers.put(party3, 3);
+		states = new PartyStates(powers);
+		phase = new OfferPhase(states, DEADLINE, evaluator);
+
+		phase1 = new OfferPhase(states, 10l, evaluator);
+		phase1a = new OfferPhase(states, 10l, evaluator);
+		phase2 = new OfferPhase(states2, 10l, evaluator);
+		phase3 = new OfferPhase(states, 20l, evaluator);
+
+	}
+
+	@Override
+	public List<List<OfferPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"OfferPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"OfferPhase.*PartyStates.*party2, party1.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"OfferPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],20,LargestAgreement.*");
+	}
+
+	@Test
+	public void smokeTest() {
+	}
+
+	@Test
+	public void testInitState() {
+		assertEquals(3, phase.getPartyStates().getNotYetActed().size());
+	}
+
+	@Test
+	public void testInform() {
+		assertEquals(new YourTurn(), phase.getInform());
+	}
+
+	@Test
+	public void isFinalTest() {
+		assertFalse(phase.isFinal(1l));
+		assertTrue(phase.isFinal(10l));
+	}
+
+	@Test
+	public void isFinalTestActorNotYetActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed())
+				.thenReturn(Collections.singleton(party1));
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertFalse(testphase.isFinal(1l));
+	}
+
+	@Test
+	public void isFinalTestAllActorsActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed()).thenReturn(Collections.emptySet());
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertTrue(testphase.isFinal(1l));
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkIncorrectActorTest() throws ProtocolException {
+		phase.checkAction(party1, new EndNegotiation(party2), 1);
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkNotAllowedActionTest() throws ProtocolException {
+		phase.checkAction(party1, new Votes(party2, Collections.emptySet()), 1);
+	}
+
+	@Test
+	public void testException() {
+		OfferPhase newphase = phase.with(new ProtocolException("bla", party1));
+		assertEquals(10l, newphase.getDeadline());
+		assertEquals(0l, phase.getPartyStates().getActions().size());
+	}
+
+	@Test
+	public void testFinish() {
+		Phase ph = phase.finish();
+		assertTrue(ph.getPartyStates().getNotYetActed().isEmpty());
+		assertEquals(3, ph.getPartyStates().getExceptions().size());
+		assertTrue(phase.getPartyStates().getAgreements().getMap().isEmpty());
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextWrong() {
+		// state is not final, should not work
+		phase.next(1, 1000);
+	}
+
+	@Test
+	public void testNextNoParties() {
+		Phase ph = phase.finish();
+		// no parties are left now, all failed
+		// but this is not part of the next() check.
+		Phase next = ph.next(1, 1000);
+		assertTrue(next instanceof VotingPhase);
+		// no remaining parties, since finish kicked all
+		assertTrue(next.getPartyStates().getNotYetActed().isEmpty());
+	}
+
+	@Test
+	public void testAllowed() {
+		phase.with(party1, offer, 1);
+	}
+
+	@Test
+	public void testAllowedWrongClass() {
+		try {
+			phase.checkAction(party1, new Accept(party1, bid), 1);
+		} catch (ProtocolException e) {
+			assertTrue(e.getMessage().contains("not allowed in OfferPhase"));
+			return;
+		}
+		fail("checkAction did not throw as expected");
+	}
+
+	@Test
+	public void testAllowedWrongActor() {
+		try {
+			phase.checkAction(party1, new Accept(party2, bid), 1);
+		} catch (ProtocolException e) {
+			assertTrue(
+					e.getMessage().contains("Incorrect actor info in action"));
+			return;
+		}
+		fail("checkAction did not throw as expected");
+	}
+
+	@Test
+	public void testAllowedActorAlreadyActed() {
+		OfferPhase testphase = phase.with(party1, offer, 1);
+
+		try {
+			testphase.checkAction(party1, offer, 2);
+		} catch (ProtocolException e) {
+			assertTrue(e.getMessage().contains("can not act anymore"));
+			return;
+		}
+		fail("checkAction did not throw as expected");
+	}
+
+	@Test
+	public void testAllowedActorAlreadyActed1() {
+		// as theoprevious test, but using with() instead of checkAction
+		OfferPhase testphase = phase.with(party1, offer, 1);
+
+		OfferPhase newphase = testphase.with(party1, offer, 2);
+		// the party must remain as acted, because we can't retract his
+		// action...
+		assertEquals(1, newphase.getPartyStates().getActions().size());
+		assertEquals(offer, newphase.getPartyStates().getActions().get(0));
+		assertFalse(
+				newphase.getPartyStates().getExceptions().containsKey(party1));
+	}
+
+	@Test
+	public void testAllowedActingTooLate() {
+
+		try {
+			phase.checkAction(party1, offer, DEADLINE + 1);
+		} catch (ProtocolException e) {
+			assertTrue(e.getMessage().contains("passed deadline"));
+			return;
+		}
+		fail("checkAction did not throw as expected");
+	}
+
+	@Test
+	public void getOffersTest() {
+		assertEquals(Collections.emptyList(), phase.getOffers());
+		List<Offer> offs = phase.with(party1, offer, 1).getOffers();
+		assertEquals(1, offs.size());
+		assertEquals(bid, offs.get(0).getBid());
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testNextTooShortDuration() {
+		phase.next(1, Phase.PHASE_MINTIME - 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextNotFinished() {
+		phase.next(1, Phase.PHASE_MINTIME + 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNext() {
+		phase.next(11, Phase.PHASE_MINTIME + 1);
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+		Phase obj = jackson.readValue(serialized, Phase.class);
+		System.out.println(obj);
+		assertEquals(phase1, obj);
+	}
+
+	@Test
+	public void testSerialize()
+			throws JsonProcessingException, URISyntaxException {
+
+		String string = jackson.writeValueAsString(phase1);
+		System.out.println(string);
+		assertEquals(serialized, string);
+	}
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OptInPhaseTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OptInPhaseTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/OptInPhaseTest.java	(revision 30)
@@ -0,0 +1,202 @@
+package geniusweb.protocol.session.mopac2.phase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import geniusweb.actions.EndNegotiation;
+import geniusweb.actions.PartyId;
+import geniusweb.actions.Vote;
+import geniusweb.actions.VoteWithValue;
+import geniusweb.actions.Votes;
+import geniusweb.actions.VotesWithValue;
+import geniusweb.inform.OptInWithValue;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.mopac2.PartyStates;
+import geniusweb.voting.VotingEvaluatorWithValue;
+import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
+import tudelft.utilities.junit.GeneralTests;
+
+/**
+ * We also test defaultPhase here.
+ */
+public class OptInPhaseTest extends GeneralTests<OptInPhase> {
+
+	private static final long DEADLINE = 10l;
+	private final PartyId party1 = new PartyId("party1");
+	private final PartyId party2 = new PartyId("party2");
+	private final PartyId party3 = new PartyId("party3");
+
+	// private final VotingPhase prevPhase = mock(VotingPhase.class);
+
+	private final Map<PartyId, Integer> powers = new HashMap<>();
+	private final PartyStates states, states2;
+	private final VotingEvaluatorWithValue evaluator = new LargestAgreementWithValue();
+	private final OptInPhase phase, phase1, phase1a, phase2, phase3;
+
+	// just a test bid
+	private final Bid bid = new Bid("issue", new DiscreteValue("yes"));
+	private final VoteWithValue vote = new VoteWithValue(party1, bid, 2, 3,
+			100);
+	private final VotesWithValue votes = new VotesWithValue(party1,
+			Collections.singleton(vote));
+
+	private final List<VotesWithValue> prevVotes = Arrays.asList(votes);
+
+	public OptInPhaseTest() {
+		powers.put(party1, 2);
+		powers.put(party2, 3);
+		states2 = new PartyStates(powers);
+		powers.put(party3, 3);
+		states = new PartyStates(powers);
+
+		phase = new OptInPhase(prevVotes, states, DEADLINE, evaluator);
+
+		// in these phases we just don't set prevPhase.
+		// this to avoid serialization troubles.
+		phase1 = new OptInPhase(null, states, 10l, evaluator);
+		phase1a = new OptInPhase(null, states, 10l, evaluator);
+		phase2 = new OptInPhase(null, states2, 10l, evaluator);
+		phase3 = new OptInPhase(null, states, 20l, evaluator);
+
+	}
+
+	@Override
+	public List<List<OptInPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"OptInPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"OptInPhase.*PartyStates.*party2, party1.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"OptInPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],20,LargestAgreement.*");
+	}
+
+	@Test
+	public void smokeTest() {
+	}
+
+	@Test
+	public void testInitState() {
+		assertEquals(3, phase.getPartyStates().getNotYetActed().size());
+	}
+
+	@Test
+	public void testInform() {
+		// when(prevPhase.getVotes()).thenReturn(Arrays.asList(votes));
+		assertEquals(new OptInWithValue(Arrays.asList(votes)),
+				phase.getInform());
+
+	}
+
+	@Test
+	public void isFinalTest() {
+		assertFalse(phase.isFinal(1l));
+		assertTrue(phase.isFinal(10l));
+	}
+
+	@Test
+	public void isFinalTestActorNotYetActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed())
+				.thenReturn(Collections.singleton(party1));
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertFalse(testphase.isFinal(1l));
+	}
+
+	@Test
+	public void isFinalTestAllActorsActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed()).thenReturn(Collections.emptySet());
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertTrue(testphase.isFinal(1l));
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkIncorrectActorTest() throws ProtocolException {
+		phase.checkAction(party1, new EndNegotiation(party2), 1);
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkNotAllowedActionTest() throws ProtocolException {
+		phase.checkAction(party1, new Votes(party2, Collections.emptySet()), 1);
+	}
+
+	@Test
+	public void testFinish() {
+		Phase ph = phase.finish();
+		assertTrue(ph.getPartyStates().getNotYetActed().isEmpty());
+		assertEquals(3, ph.getPartyStates().getExceptions().size());
+		assertTrue(phase.getPartyStates().getAgreements().getMap().isEmpty());
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextWrong() {
+		// state is not final, should not work
+		phase.next(1, 1000);
+	}
+
+	@Test
+	public void testNextNoParties() {
+		Phase ph = phase.finish();
+		// no parties are left now, all failed
+		// but this is not part of the next() check.
+		Phase next = ph.next(1, 1000);
+		assertTrue(next instanceof OfferPhase);
+		// no remaining parties, since finish kicked all
+		assertTrue(next.getPartyStates().getNotYetActed().isEmpty());
+	}
+
+	@Test
+	public void testAllowed() {
+		// when(prevPhase.getVotes()).thenReturn(Arrays.asList(votes));
+		phase.with(party1, votes, 1l);
+	}
+
+	@Test
+	public void testAllowedNarrowingVote() {
+		// the previous vote was maxPower=3,
+		// so this is an illegal narrowing of the previous vote
+		Vote newVote = new Vote(party1, bid, 2, 2);
+		Votes newVotes = new Votes(party1, Collections.singleton(newVote));
+
+		// when(prevPhase.getVotes()).thenReturn(Arrays.asList(votes));
+
+		// check that party1 was kicked
+		Phase newphase = phase.with(party1, newVotes, 1l);
+		assertTrue(
+				newphase.getPartyStates().getExceptions().containsKey(party1));
+
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testNextTooShortDuration() {
+		phase.next(1, Phase.PHASE_MINTIME - 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextNotFinished() {
+		phase.next(1, Phase.PHASE_MINTIME + 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNext() {
+		phase.next(11, Phase.PHASE_MINTIME + 1);
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/VotingPhaseTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/VotingPhaseTest.java	(revision 30)
+++ protocol/src/test/java/geniusweb/protocol/session/mopac2/phase/VotingPhaseTest.java	(revision 30)
@@ -0,0 +1,192 @@
+package geniusweb.protocol.session.mopac2.phase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import geniusweb.actions.EndNegotiation;
+import geniusweb.actions.Offer;
+import geniusweb.actions.PartyId;
+import geniusweb.actions.VoteWithValue;
+import geniusweb.actions.VotesWithValue;
+import geniusweb.inform.Voting;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.mopac2.PartyStates;
+import geniusweb.voting.VotingEvaluatorWithValue;
+import geniusweb.voting.evaluatorwithvalue.LargestAgreementWithValue;
+import tudelft.utilities.junit.GeneralTests;
+
+/**
+ * We also test defaultPhase here.
+ */
+public class VotingPhaseTest extends GeneralTests<VotingPhase> {
+
+	private static final long DEADLINE = 10l;
+	private final PartyId party1 = new PartyId("party1");
+	private final PartyId party2 = new PartyId("party2");
+	private final PartyId party3 = new PartyId("party3");
+
+	// private final OfferPhase prevPhase = mock(OfferPhase.class);
+
+	private final Map<PartyId, Integer> powers = new HashMap<>();
+	private final PartyStates states, states2;
+	private final VotingEvaluatorWithValue evaluator = new LargestAgreementWithValue();
+	private final VotingPhase phase, phase1, phase1a, phase2, phase3;
+
+	// just a test bid
+	private final Bid bid = new Bid("issue", new DiscreteValue("yes"));
+	private final VoteWithValue vote = new VoteWithValue(party1, bid, 2, 3,
+			100);
+	private final VotesWithValue votes = new VotesWithValue(party1,
+			Collections.singleton(vote));
+
+	private final List<Offer> prevPhase = Arrays.asList(new Offer(party1, bid));
+
+	public VotingPhaseTest() {
+		powers.put(party1, 2);
+		powers.put(party2, 3);
+		states2 = new PartyStates(powers);
+		powers.put(party3, 3);
+		states = new PartyStates(powers);
+
+		phase = new VotingPhase(prevPhase, states, DEADLINE, evaluator);
+
+		// in these phases we just don't set prevPhase.
+		// this to avoid serialization troubles.
+		phase1 = new VotingPhase(null, states, 10l, evaluator);
+		phase1a = new VotingPhase(null, states, 10l, evaluator);
+		phase2 = new VotingPhase(null, states2, 10l, evaluator);
+		phase3 = new VotingPhase(null, states, 20l, evaluator);
+
+	}
+
+	@Override
+	public List<List<VotingPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3));
+	}
+
+	@Override
+	public List<String> getGeneralTestStrings() {
+		return Arrays.asList(
+				"VotingPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"VotingPhase.*PartyStates.*party2, party1.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreement.*",
+				"VotingPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],20,LargestAgreement.*");
+	}
+
+	@Test
+	public void smokeTest() {
+	}
+
+	@Test
+	public void testInitState() {
+		assertEquals(3, phase.getPartyStates().getNotYetActed().size());
+	}
+
+	@Test
+	public void testInform() {
+		// when(prevPhase.getOffers()).thenReturn(Arrays.asList(bid));
+		assertEquals(new Voting(Arrays.asList(new Offer(party1, bid)), powers),
+				phase.getInform());
+
+	}
+
+	@Test
+	public void isFinalTest() {
+		assertFalse(phase.isFinal(1l));
+		assertTrue(phase.isFinal(10l));
+	}
+
+	@Test
+	public void isFinalTestActorNotYetActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed())
+				.thenReturn(Collections.singleton(party1));
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertFalse(testphase.isFinal(1l));
+	}
+
+	@Test
+	public void isFinalTestAllActorsActed() {
+		PartyStates actedstate = mock(PartyStates.class);
+		when(actedstate.getNotYetActed()).thenReturn(Collections.emptySet());
+		OfferPhase testphase = new OfferPhase(actedstate, 10l, evaluator);
+		assertTrue(testphase.isFinal(1l));
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkIncorrectActorTest() throws ProtocolException {
+		phase.checkAction(party1, new EndNegotiation(party2), 1);
+	}
+
+	@Test(expected = ProtocolException.class)
+	public void checkNotAllowedActionTest() throws ProtocolException {
+		phase.checkAction(party2,
+				new VotesWithValue(party1, Collections.singleton(vote)), 1);
+	}
+
+	@Test
+	public void testFinish() {
+		Phase ph = phase.finish();
+		assertTrue(ph.getPartyStates().getNotYetActed().isEmpty());
+		assertEquals(3, ph.getPartyStates().getExceptions().size());
+		assertTrue(phase.getPartyStates().getAgreements().getMap().isEmpty());
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextWrong() {
+		// state is not final, should not work
+		phase.next(1, 1000);
+	}
+
+	@Test
+	public void testNextNoParties() {
+		Phase ph = phase.finish();
+		// no parties are left now, all failed
+		// but this is not part of the next() check.
+		Phase next = ph.next(1, 1000);
+		assertTrue(next instanceof OptInPhase);
+		// no remaining parties, since finish kicked all
+		assertTrue(next.getPartyStates().getNotYetActed().isEmpty());
+	}
+
+	@Test
+	public void testAllowed() {
+		phase.with(party1, votes, 1);
+	}
+
+	@Test
+	public void getVotesTest() {
+		assertEquals(Collections.emptyList(), phase.getVotes());
+		List<VotesWithValue> vts = phase.with(party1, votes, 1).getVotes();
+		assertEquals(Arrays.asList(votes), vts);
+	}
+
+	@Test(expected = IllegalArgumentException.class)
+	public void testNextTooShortDuration() {
+		phase.next(1, Phase.PHASE_MINTIME - 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNextNotFinished() {
+		phase.next(1, Phase.PHASE_MINTIME + 1);
+	}
+
+	@Test(expected = IllegalStateException.class)
+	public void testNext() {
+		phase.next(11, Phase.PHASE_MINTIME + 1);
+	}
+
+}
Index: protocol/src/test/java/geniusweb/protocol/session/saop/SAOPSettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/saop/SAOPSettingsTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/saop/SAOPSettingsTest.java	(revision 30)
@@ -19,6 +19,6 @@
 import geniusweb.deadline.DeadlineRounds;
 import geniusweb.deadline.DeadlineTime;
-import geniusweb.protocol.session.OnePartyTeam;
 import geniusweb.protocol.session.SessionSettings;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
@@ -30,11 +30,11 @@
 public class SAOPSettingsTest extends GeneralTests<SAOPSettings> {
 
-	private OnePartyTeam partyprof1 = mock(OnePartyTeam.class);
-	private OnePartyTeam partyprof2 = mock(OnePartyTeam.class);
-	private OnePartyTeam partyprof3 = mock(OnePartyTeam.class);
-	private List<OnePartyTeam> participants2 = Arrays.asList(partyprof1,
+	private TeamInfo partyprof1 = mock(TeamInfo.class);
+	private TeamInfo partyprof2 = mock(TeamInfo.class);
+	private TeamInfo partyprof3 = mock(TeamInfo.class);
+	private List<TeamInfo> participants2 = Arrays.asList(partyprof1,
 			partyprof2);
-	private List<OnePartyTeam> participants3 = Arrays.asList(partyprof1,
-			partyprof2, partyprof3);
+	private List<TeamInfo> participants3 = Arrays.asList(partyprof1, partyprof2,
+			partyprof3);
 
 	private DeadlineTime deadline = mock(DeadlineTime.class);
@@ -47,5 +47,5 @@
 
 	private SAOPSettings sersettings;
-	private final String serialized = "{\"SAOPSettings\":{\"participants\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"},{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}}}}";
+	private final String serialized = "{\"SAOPSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party1\",\"parameters\":{}},\"profile\":\"http://profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"http://party2\",\"parameters\":{}},\"profile\":\"http://profile2\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":100}}}}";
 
 	@Before
@@ -54,4 +54,8 @@
 		when(deadline.toString()).thenReturn("deadline");
 		when(deadline2.toString()).thenReturn("deadline2");
+
+		when(partyprof1.getSize()).thenReturn(1);
+		when(partyprof2.getSize()).thenReturn(1);
+		when(partyprof3.getSize()).thenReturn(1);
 
 		when(partyprof1.toString()).thenReturn("party and profile 1");
@@ -67,7 +71,7 @@
 				new PartyRef("http://party2"), new Parameters());
 		ProfileRef profile2 = new ProfileRef("http://profile2");
-		OnePartyTeam partywithprof1 = new OnePartyTeam(party1, profile1);
-		OnePartyTeam partywithprof2 = new OnePartyTeam(party2, profile2);
-		List<OnePartyTeam> participants = Arrays.asList(partywithprof1,
+		TeamInfo partywithprof1 = new TeamInfo(party1, profile1);
+		TeamInfo partywithprof2 = new TeamInfo(party2, profile2);
+		List<TeamInfo> participants = Arrays.asList(partywithprof1,
 				partywithprof2);
 
Index: protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java	(revision 30)
@@ -20,6 +20,6 @@
 import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
-
+
+import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
@@ -44,6 +44,5 @@
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
-import geniusweb.protocol.session.OnePartyTeam;
-import geniusweb.protocol.session.TeamOfPartiesAndProfiles;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
@@ -71,5 +70,5 @@
 			finalstate = mock(SAOPState.class);
 
-	private final ProtocolRef SAOP;
+	private ProtocolRef SAOP;
 	private static final PartyId PARTY2ID = new PartyId("party2");
 	private static final PartyId PARTY1ID = new PartyId("party1");
@@ -77,6 +76,6 @@
 	private final PartyRef party2ref = mock(PartyRef.class);
 	private final SAOPSettings settings = mock(SAOPSettings.class);
-	private final OnePartyTeam team1 = mock(OnePartyTeam.class);
-	private final OnePartyTeam team2 = mock(OnePartyTeam.class);
+	private final TeamInfo team1 = mock(TeamInfo.class);
+	private final TeamInfo team2 = mock(TeamInfo.class);
 	private SAOP saop;
 	private ProtocolToPartyConnFactory factory;
@@ -84,5 +83,5 @@
 	private ProtocolToPartyConn conn1 = mock(ProtocolToPartyConn.class),
 			conn2 = mock(ProtocolToPartyConn.class);
-	private Map<PartyId, OnePartyTeam> partyprofiles;
+	private Map<PartyId, TeamInfo> partyprofiles;
 	private Progress progress = mock(Progress.class);
 	private ProfileRef profile1;
@@ -102,11 +101,16 @@
 	private final Deadline deadlinetime = mock(DeadlineTime.class);
 
-	public SAOPTest()
+	@Before
+	public void before()
 			throws URISyntaxException, IOException, NoResourcesNowException {
 		SAOP = new ProtocolRef("SAOP");
-		when(team1.getParty()).thenReturn(partywithparam1);
-		when(team2.getParty()).thenReturn(partywithparam2);
-		when(team1.getAllParties()).thenReturn(Arrays.asList(team1));
-		when(team2.getAllParties()).thenReturn(Arrays.asList(team2));
+
+		profile1 = mock(ProfileRef.class);
+		profile2 = mock(ProfileRef.class);
+
+		PartyWithProfile pwp1 = new PartyWithProfile(partywithparam1, profile1);
+		PartyWithProfile pwp2 = new PartyWithProfile(partywithparam2, profile2);
+		when(team1.getAllParties()).thenReturn(Arrays.asList(pwp1));
+		when(team2.getAllParties()).thenReturn(Arrays.asList(pwp2));
 
 		partyprofiles = new HashMap<>();
@@ -116,9 +120,9 @@
 		when(deadlinetime.getDuration()).thenReturn(1000l);
 
-		List<TeamOfPartiesAndProfiles> teams = new ArrayList<>();
+		List<TeamInfo> teams = new ArrayList<>();
 		teams.add(team1);
 		teams.add(team2);
 		when(settings.getTeams()).thenReturn(teams);
-		when(settings.getAllParties()).thenReturn(Arrays.asList(team1, team2));
+		when(settings.getAllParties()).thenReturn(Arrays.asList(pwp1, pwp2));
 		when(settings.getDeadline()).thenReturn(deadlinetime);
 
@@ -131,9 +135,4 @@
 		when(conn1.getParty()).thenReturn(PARTY1ID);
 		when(conn2.getParty()).thenReturn(PARTY2ID);
-
-		profile1 = mock(ProfileRef.class);
-		when(team1.getProfile()).thenReturn(profile1);
-		profile2 = mock(ProfileRef.class);
-		when(team2.getProfile()).thenReturn(profile2);
 
 		mockState(connectedstate, "connected state");
@@ -153,4 +152,10 @@
 		saop = new SAOP(state, new ReportToLogger("test"));
 		saop.addListener(testlistener);
+
+		Map<PartyId, PartyWithProfile> profilesmap = new HashMap<>();
+		profilesmap.put(PARTY1ID, pwp1);
+		profilesmap.put(PARTY2ID, pwp2);
+		when(state.getPartyProfiles()).thenReturn(profilesmap);
+
 	}
 
@@ -164,7 +169,5 @@
 		when(state.getSettings()).thenReturn(settings);
 		when(state.getConnections()).thenReturn(connectionswithparties);
-		when(state.getPartyProfiles())
-				.thenReturn(partyprofiles.entrySet().stream().collect(
-						Collectors.toMap(e -> e.getKey(), e -> e.getValue())));
+
 		when(state.getProgress()).thenReturn(progress);
 		when(state.with(any(ProtocolToPartyConn.class),
Index: protocol/src/test/java/geniusweb/protocol/session/saop/SaopPartyWithProfileTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/saop/SaopPartyWithProfileTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/saop/SaopPartyWithProfileTest.java	(revision 30)
@@ -17,6 +17,5 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-import geniusweb.protocol.session.OnePartyTeam;
-import geniusweb.protocol.session.TeamOfPartiesAndProfiles;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
@@ -25,11 +24,11 @@
 import tudelft.utilities.junit.GeneralTests;
 
-public class SaopPartyWithProfileTest extends GeneralTests<OnePartyTeam> {
+public class SaopPartyWithProfileTest extends GeneralTests<TeamInfo> {
 
 	private PartyRef party1, party1a, party2, party3;
 	private ProfileRef profile1, profile2;
-	private OnePartyTeam partyprof1, partyprof1a, partyprof2, partyprof3,
+	private TeamInfo partyprof1, partyprof1a, partyprof2, partyprof3,
 			partyprof4;
-	private final String serialized = "{\"party\":{\"partyref\":\"ws:party1\",\"parameters\":{}},\"profile\":\"ws:profile1\"}";
+	private final String serialized = "{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"ws:party1\",\"parameters\":{}},\"profile\":\"ws:profile1\"}]}}";
 
 	@Before
@@ -54,14 +53,14 @@
 				settings1);
 
-		partyprof1 = new OnePartyTeam(party1withparams1, profile1);
-		partyprof1a = new OnePartyTeam(party1withparams1, profile1);
-		partyprof2 = new OnePartyTeam(party2withparams1, profile1);
-		partyprof3 = new OnePartyTeam(party1withparams1, profile2);
-		partyprof4 = new OnePartyTeam(party1withparams2, profile1);
+		partyprof1 = new TeamInfo(party1withparams1, profile1);
+		partyprof1a = new TeamInfo(party1withparams1, profile1);
+		partyprof2 = new TeamInfo(party2withparams1, profile1);
+		partyprof3 = new TeamInfo(party1withparams1, profile2);
+		partyprof4 = new TeamInfo(party1withparams2, profile1);
 
 	}
 
 	@Override
-	public List<List<OnePartyTeam>> getGeneralTestData() {
+	public List<List<TeamInfo>> getGeneralTestData() {
 		return Arrays.asList(Arrays.asList(partyprof1, partyprof1a),
 				Arrays.asList(partyprof2), Arrays.asList(partyprof3),
@@ -72,8 +71,8 @@
 	public List<String> getGeneralTestStrings() {
 		return Arrays.asList(
-				"PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile1.*",
-				"PartyWithProfile.PartyRef.ws:party2.,ProfileRef.ws:profile1.*",
-				"PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile2.*",
-				"PartyWithProfile.PartyRef.ws:party1.\\{a=1\\},ProfileRef.ws:profile1.*");
+				"TeamInfo.*PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile1.*",
+				"TeamInfo.*PartyWithProfile.PartyRef.ws:party2.,ProfileRef.ws:profile1.*",
+				"TeamInfo.*PartyWithProfile.PartyRef.ws:party1.,ProfileRef.ws:profile2.*",
+				"TeamInfo.*PartyWithProfile.PartyRef.ws:party1.\\{a=1\\},ProfileRef.ws:profile1.*");
 	}
 
@@ -84,5 +83,5 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void nullTest() throws URISyntaxException {
-		new OnePartyTeam((PartyWithParameters) null, (ProfileRef) null);
+		new TeamInfo((PartyWithParameters) null, (ProfileRef) null);
 	}
 
@@ -102,6 +101,5 @@
 		// always used as part of bigger class, do not include class name
 		// and therfore can not serialize as TeamOfPartiesAndProfiles
-		TeamOfPartiesAndProfiles p = jackson.readValue(serialized,
-				OnePartyTeam.class);
+		TeamInfo p = jackson.readValue(serialized, TeamInfo.class);
 		System.out.println(p);
 		assertEquals(partyprof1, p);
Index: protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPSettingsTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPSettingsTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPSettingsTest.java	(revision 30)
@@ -16,4 +16,5 @@
 import geniusweb.deadline.DeadlineTime;
 import geniusweb.protocol.session.SessionSettings;
+import geniusweb.protocol.session.TeamInfo;
 import geniusweb.references.Parameters;
 import geniusweb.references.PartyRef;
@@ -28,7 +29,7 @@
 	private final ObjectMapper jackson = new ObjectMapper();
 	private Parameters params = new Parameters();
-	private final String serialized = "{\"SHAOPSettings\":{\"participants\":[{\"cob\":{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile1\"},\"shaop\":{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"}},{\"cob\":{\"party\":{\"partyref\":\"party4\",\"parameters\":{}},\"profile\":\"profile1\"},\"shaop\":{\"party\":{\"partyref\":\"party3\",\"parameters\":{}},\"profile\":\"profile1\"}}],\"deadline\":{\"deadlinetime\":{\"durationms\":1000}}}}";
+	private final String serialized = "{\"SHAOPSettings\":{\"participants\":[{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"party1\",\"parameters\":{}},\"profile\":\"profile1\"},{\"party\":{\"partyref\":\"party2\",\"parameters\":{}},\"profile\":\"profile1\"}]}},{\"TeamInfo\":{\"parties\":[{\"party\":{\"partyref\":\"party3\",\"parameters\":{}},\"profile\":\"profile1\"},{\"party\":{\"partyref\":\"party4\",\"parameters\":{}},\"profile\":\"profile1\"}]}}],\"deadline\":{\"deadlinetime\":{\"durationms\":1000}}}}";
 	private SHAOPSettings settings1, settings1a, settings2, settings3;
-	private ShaopTeam pair1, pair2, pair3;
+	private TeamInfo pair1, pair2, pair3;
 
 	@Before
@@ -57,7 +58,7 @@
 		DeadlineTime deadline = new DeadlineTime(1000);
 		DeadlineTime deadline2 = new DeadlineTime(2000);
-		pair1 = new ShaopTeam(partyprof1, partyprof2);
-		pair2 = new ShaopTeam(partyprof3, partyprof4);
-		pair3 = new ShaopTeam(partyprof5, partyprof6);
+		pair1 = new TeamInfo(Arrays.asList(partyprof1, partyprof2));
+		pair2 = new TeamInfo(Arrays.asList(partyprof3, partyprof4));
+		pair3 = new TeamInfo(Arrays.asList(partyprof5, partyprof6));
 
 		settings1 = new SHAOPSettings(Arrays.asList(pair1, pair2), deadline);
@@ -76,7 +77,7 @@
 	public List<String> getGeneralTestStrings() {
 		return Arrays.asList(
-				"SHAOPSettings.*Parties.*PartyWithProfile.*party1.*party2.*Parties.*party3.*party4.*DeadlineTime.*1000.*",
-				"SHAOPSettings.*Parties.*PartyWithProfile.*party1.*party2.*Parties.*party5.*party6.*DeadlineTime.*1000.*",
-				"SHAOPSettings.*Parties.*PartyWithProfile.*party1.*party2.*Parties.*party3.*party4.*DeadlineTime.*2000.*");
+				"SHAOPSettings.*TeamInfo.*PartyWithProfile.*party1.*party2.*TeamInfo.*party3.*party4.*DeadlineTime.*1000.*",
+				"SHAOPSettings.*TeamInfo.*PartyWithProfile.*party1.*party2.*TeamInfo.*party5.*party6.*DeadlineTime.*1000.*",
+				"SHAOPSettings.*TeamInfo.*PartyWithProfile.*party1.*party2.*TeamInfo.*party3.*party4.*DeadlineTime.*2000.*");
 	}
 
Index: protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPStateTest.java
===================================================================
--- protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPStateTest.java	(revision 29)
+++ protocol/src/test/java/geniusweb/protocol/session/shaop/SHAOPStateTest.java	(revision 30)
@@ -32,5 +32,5 @@
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
 import geniusweb.protocol.session.SessionResult;
-import geniusweb.protocol.session.TeamOfPartiesAndProfiles;
+import geniusweb.protocol.session.TeamInfo;
 import tudelft.utilities.junit.GeneralTests;
 
@@ -75,8 +75,8 @@
 	private Map<PartyId, Integer> partynrs = new HashMap<>();
 
-	private TeamOfPartiesAndProfiles team1 = mock(
-			TeamOfPartiesAndProfiles.class);
-	private TeamOfPartiesAndProfiles team2 = mock(
-			TeamOfPartiesAndProfiles.class);
+	private TeamInfo team1 = mock(
+			TeamInfo.class);
+	private TeamInfo team2 = mock(
+			TeamInfo.class);
 
 	@Before
