Index: /bidspace/pom.xml
===================================================================
--- /bidspace/pom.xml	(revision 23)
+++ /bidspace/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>bidspace</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -16,5 +16,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -159,5 +159,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -166,8 +166,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /bidspace/src/main/java/geniusweb/bidspace/AllBidsList.java
===================================================================
--- /bidspace/src/main/java/geniusweb/bidspace/AllBidsList.java	(revision 23)
+++ /bidspace/src/main/java/geniusweb/bidspace/AllBidsList.java	(revision 24)
@@ -26,6 +26,8 @@
 
 	/**
-	 * A list containing all bids in the space. This is an ImmutableList so it
-	 * can contain all bids without pre-computing them.
+	 * This object contains s list containing all bids in the space. This is an
+	 * ImmutableList so it can contain all bids without pre-computing them.
+	 * 
+	 * @param domain the {@link Domain}
 	 * 
 	 */
Index: /bidspace/src/main/java/geniusweb/bidspace/AllPartialBidsList.java
===================================================================
--- /bidspace/src/main/java/geniusweb/bidspace/AllPartialBidsList.java	(revision 23)
+++ /bidspace/src/main/java/geniusweb/bidspace/AllPartialBidsList.java	(revision 24)
@@ -32,4 +32,5 @@
 	 * pre-computing them.
 	 * 
+	 * @param domain the {@link Domain}
 	 */
 	public AllPartialBidsList(Domain domain) {
Index: /bidspace/src/main/java/geniusweb/bidspace/BidsWithUtility.java
===================================================================
--- /bidspace/src/main/java/geniusweb/bidspace/BidsWithUtility.java	(revision 23)
+++ /bidspace/src/main/java/geniusweb/bidspace/BidsWithUtility.java	(revision 24)
@@ -43,5 +43,5 @@
 	 * Default constructor, uses default precision 6. This value seems practical
 	 * for the common range of issues, utilities and weights. See
-	 * {@link #BidsWithUtil(LinearAdditive, int)} for more details on the
+	 * {@link #BidsWithUtility(LinearAdditive, int)} for more details on the
 	 * precision.
 	 * 
@@ -73,6 +73,4 @@
 	 *                  digits should be feasible; for 9 issues, 6 digits may be
 	 *                  the maximum.
-	 *                  <p>
-	 * 
 	 */
 	public BidsWithUtility(LinearAdditive space, int precision) {
@@ -138,6 +136,6 @@
 	 * utilities in given range.
 	 * 
-	 * @param n    the number of {@link #issueRanges} to consider, we consider
-	 *             0..n here. The recursion decreases n until n=0
+	 * @param n    the number of issueRanges to consider, we consider 0..n here.
+	 *             The recursion decreases n until n=0
 	 * @param goal the minimum and maximum utility required of the bids. to be
 	 *             included (both ends inclusive)
Index: /bidspace/src/main/java/geniusweb/bidspace/Interval.java
===================================================================
--- /bidspace/src/main/java/geniusweb/bidspace/Interval.java	(revision 23)
+++ /bidspace/src/main/java/geniusweb/bidspace/Interval.java	(revision 24)
@@ -16,9 +16,9 @@
 
 	/**
-	 * AN interval [min,max]. If min>max, then there are no values in this
+	 * AN interval [min,max]. If min &gt; max, then there are no values in this
 	 * interval.
 	 * 
-	 * @param min
-	 * @param max
+	 * @param min the minimum value of the interval
+	 * @param max the maximum value of the interval
 	 */
 	public Interval(BigDecimal min, BigDecimal max) {
@@ -49,5 +49,5 @@
 	 * 
 	 * @param value the value to test
-	 * @return true iff min<=value<=max
+	 * @return true iff min &le; value &le; max
 	 */
 	public boolean contains(BigDecimal value) {
@@ -66,6 +66,7 @@
 	/**
 	 * 
-	 * @param minMax another minMax to intersect with
-	 * @return intersection with other. returns null if intersection is empty.
+	 * @param other another {@link Interval} intersect with
+	 * @return intersection of this with other. returns null if intersection is
+	 *         empty.
 	 */
 	public Interval intersect(Interval other) {
Index: /bidspace/src/main/java/geniusweb/bidspace/IssueInfo.java
===================================================================
--- /bidspace/src/main/java/geniusweb/bidspace/IssueInfo.java	(revision 23)
+++ /bidspace/src/main/java/geniusweb/bidspace/IssueInfo.java	(revision 24)
@@ -26,4 +26,14 @@
 	private final Map<Value, BigDecimal> weightedUtils;
 
+	/**
+	 * 
+	 * @param name      the issue name
+	 * @param values    the {@link ValueSet} of the issue
+	 * @param utils     the {@link ValueSetUtilities} of the issue profile
+	 * @param weight    the weight of the {@link ValueSetUtilities}
+	 * @param precision the precision to compute with. Basically the number of
+	 *                  decimal places used for the computations.
+	 * 
+	 */
 	public IssueInfo(String name, ValueSet values, ValueSetUtilities utils,
 			BigDecimal weight, int precision) {
@@ -45,5 +55,5 @@
 	 * 
 	 * @return weighted minimum and maximum utility achievable with this issue,
-	 *         rounded to the {@link #precision}.
+	 *         rounded to the requested precision.
 	 */
 	public Interval getInterval() {
@@ -53,5 +63,6 @@
 	/**
 	 * 
-	 * @param isMax
+	 * @param isMax if true the max {@link Value} is returned, else the min is
+	 *              returned.
 	 * @return the extreme value, either the minimum if isMax=false or maximum
 	 *         if isMax=true
@@ -86,5 +97,5 @@
 	 * @param val the issue value to be evaluated
 	 * @return weighted utility of given value, rounded to nearest value with
-	 *         {@link #precision} digits.
+	 *         the requested precision number of digits.
 	 */
 	public BigDecimal getWeightedUtil(Value val) {
Index: /boa/pom.xml
===================================================================
--- /boa/pom.xml	(revision 23)
+++ /boa/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>boa</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -146,5 +146,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -153,8 +153,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /boa/src/main/java/geniusweb/boa/BoaState.java
===================================================================
--- /boa/src/main/java/geniusweb/boa/BoaState.java	(revision 23)
+++ /boa/src/main/java/geniusweb/boa/BoaState.java	(revision 24)
@@ -38,4 +38,6 @@
 	/**
 	 * Initial state. Update using with(settings).
+	 * 
+	 * @param reporter the {@link Reporter} to use for logging
 	 */
 	public BoaState(Reporter reporter) {
@@ -83,9 +85,8 @@
 	 * This should be the first update call used.
 	 * 
-	 * @param settings    the negoi {@link Settings}
+	 * @param newsettings the negoi {@link Settings}
 	 * @param bidstrat    the {@link BiddingStrategy}
 	 * @param acceptstrat the {@link AcceptanceStrategy}
 	 * @param omClass     the class of the {@link OpponentModel}
-	 * @param reporter    the {@link Reporter} that can be used to log messages
 	 * @return initialized BoaState
 	 */
@@ -175,5 +176,5 @@
 	/**
 	 * 
-	 * @param bid
+	 * @param bid the {@link Bid} to check
 	 * @return true iff {@link #acceptanceStrategy} says the bid is acceptable
 	 */
Index: /boa/src/main/java/geniusweb/boa/DefaultBoa.java
===================================================================
--- /boa/src/main/java/geniusweb/boa/DefaultBoa.java	(revision 23)
+++ /boa/src/main/java/geniusweb/boa/DefaultBoa.java	(revision 24)
@@ -106,4 +106,6 @@
 	 * @param settings the {@link Settings}
 	 * @return the {@link OpponentModel} class to use for modeling opponents
+	 * @throws InstantiationFailedException if the requested opponent model can
+	 *                                      not be loaded
 	 */
 	abstract protected Class<? extends OpponentModel> getOpponentModel(
@@ -117,4 +119,6 @@
 	 * @return the {@link BiddingStrategy} to use for determining the next
 	 *         {@link Action}
+	 * @throws InstantiationFailedException if the requested opponent model can
+	 *                                      not be loaded
 	 */
 	abstract protected BiddingStrategy getBiddingStrategy(Settings settings)
@@ -128,4 +132,6 @@
 	 * @return the {@link AcceptanceStrategy} to use for determining if a bid is
 	 *         acceptable
+	 * @throws InstantiationFailedException if the requested opponent model can
+	 *                                      not be loaded
 	 */
 	abstract protected AcceptanceStrategy getAccceptanceStrategy(
Index: /boa/src/main/java/geniusweb/boa/biddingstrategy/ExtendedUtilSpace.java
===================================================================
--- /boa/src/main/java/geniusweb/boa/biddingstrategy/ExtendedUtilSpace.java	(revision 23)
+++ /boa/src/main/java/geniusweb/boa/biddingstrategy/ExtendedUtilSpace.java	(revision 24)
@@ -93,5 +93,5 @@
 
 	/**
-	 * @param utilityGoal
+	 * @param utilityGoal the intended utilty
 	 * @return bids with utility inside [utilitygoal-tolerance, utilitygoal]
 	 */
Index: /boa/src/main/java/geniusweb/boa/biddingstrategy/TimeDependentBiddingStrategy.java
===================================================================
--- /boa/src/main/java/geniusweb/boa/biddingstrategy/TimeDependentBiddingStrategy.java	(revision 23)
+++ /boa/src/main/java/geniusweb/boa/biddingstrategy/TimeDependentBiddingStrategy.java	(revision 24)
@@ -242,5 +242,5 @@
 	 * Overridable eg for tests
 	 * 
-	 * @param profile
+	 * @param profile a {@link LinearAdditive} profile
 	 * 
 	 * @return {@link ExtendedUtilSpace}
Index: /collectparties.sh
===================================================================
--- /collectparties.sh	(revision 23)
+++ /collectparties.sh	(revision 24)
@@ -7,5 +7,5 @@
 rm -rf collectedparties
 mkdir collectedparties
-VERSION=1.5.2
+VERSION=1.5.3
 
 cp "exampleparties/anac2019/agentgg/target/agentgg-${VERSION}-jar-with-dependencies.jar" collectedparties
Index: /events/pom.xml
===================================================================
--- /events/pom.xml	(revision 23)
+++ /events/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>events</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -157,5 +157,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -164,8 +164,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /events/src/main/java/geniusweb/actions/Votes.java
===================================================================
--- /events/src/main/java/geniusweb/actions/Votes.java	(revision 23)
+++ /events/src/main/java/geniusweb/actions/Votes.java	(revision 24)
@@ -57,5 +57,6 @@
 	 * with power at most P.
 	 * 
-	 * @param otherVotes
+	 * @param otherVotes the {@link Votes}, usually from a previous round, that
+	 *                   this should extend.
 	 * @return true iff this extends the otherVotes.
 	 */
@@ -65,7 +66,6 @@
 		for (Vote vote : otherVotes.getVotes()) {
 			Vote myvote = getVote(vote.getBid());
-			if (myvote == null)
-				return false;
-			if (myvote.getMinPower() > vote.getMinPower())
+			if (myvote == null || myvote.getMinPower() > vote.getMinPower()
+					|| myvote.getMaxPower() < vote.getMaxPower())
 				return false;
 		}
Index: /events/src/main/java/geniusweb/events/ActionEvent.java
===================================================================
--- /events/src/main/java/geniusweb/events/ActionEvent.java	(revision 23)
+++ /events/src/main/java/geniusweb/events/ActionEvent.java	(revision 24)
@@ -18,5 +18,5 @@
 	/**
 	 * 
-	 * @param action
+	 * @param action the {@link Action} that was done
 	 * @param time   the current time to use. see
 	 *               {@link System#currentTimeMillis()}.
Index: /events/src/main/java/geniusweb/events/NegotiationEvent.java
===================================================================
--- /events/src/main/java/geniusweb/events/NegotiationEvent.java	(revision 23)
+++ /events/src/main/java/geniusweb/events/NegotiationEvent.java	(revision 24)
@@ -6,4 +6,6 @@
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
+
+import geniusweb.actions.Action;
 
 /**
Index: /events/src/main/java/geniusweb/inform/Agreements.java
===================================================================
--- /events/src/main/java/geniusweb/inform/Agreements.java	(revision 23)
+++ /events/src/main/java/geniusweb/inform/Agreements.java	(revision 24)
@@ -51,6 +51,6 @@
 
 	/**
-	 * @param bid
-	 * @param parties
+	 * @param bid     a {@link Bid} to be added
+	 * @param parties {@link Set} of the {@link PartyId}s that accepted the bid
 	 * @return new Agreements, with the new bid/parties added.
 	 */
Index: /events/src/main/java/geniusweb/inform/Finished.java
===================================================================
--- /events/src/main/java/geniusweb/inform/Finished.java	(revision 23)
+++ /events/src/main/java/geniusweb/inform/Finished.java	(revision 24)
@@ -15,9 +15,10 @@
 	 * The session finished (can be for any reason).
 	 * 
-	 * @param agreedBid the bid that was finally agreed on; null if no
-	 *                  agreement.
+	 * @param agreements the {@link Agreements} that were finally agreed on.
 	 */
 	@JsonCreator
 	public Finished(@JsonProperty("agreements") Agreements agreements) {
+		if (agreements == null)
+			throw new NullPointerException("Agreements can't be null");
 		this.agreements = agreements;
 	}
Index: /events/src/main/java/geniusweb/inform/Inform.java
===================================================================
--- /events/src/main/java/geniusweb/inform/Inform.java	(revision 23)
+++ /events/src/main/java/geniusweb/inform/Inform.java	(revision 24)
@@ -7,5 +7,5 @@
 
 /**
- * base class of all information sent to the {@link Party}
+ * base class of all information sent to a Party
  */
 @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
Index: /events/src/main/java/geniusweb/inform/Settings.java
===================================================================
--- /events/src/main/java/geniusweb/inform/Settings.java	(revision 23)
+++ /events/src/main/java/geniusweb/inform/Settings.java	(revision 24)
@@ -2,4 +2,5 @@
 
 import java.util.HashMap;
+import java.util.Map;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
@@ -13,7 +14,6 @@
 
 /**
- * Informs a {@link Party} about all settings for the upcoming negotiation
- * session. This should be sent to a party one time, so that the party knows the
- * situation.
+ * Informs a Party about all settings for the upcoming negotiation session. This
+ * should be sent to a party one time, so that the party knows the situation.
  *
  */
@@ -31,10 +31,10 @@
 	 * @param protocol   the protocol used in this session
 	 * @param progress   the {@link Progress} object used for this session
-	 * @param parameters a Map<String, Object> containing initialization
-	 *                   parameters for this party. The Object can be a HashMap,
-	 *                   ArrayList, String, or number (Integer, Double, etc).
-	 *                   The Object should not be just any Object because
-	 *                   deserialization will work only with the mentioned
-	 *                   types.
+	 * @param parameters a {@link Map} &lt;String, Object&gt; containing
+	 *                   initialization parameters for this party. The Object
+	 *                   can be a HashMap, ArrayList, String, or number
+	 *                   (Integer, Double, etc). The Object should not be just
+	 *                   any Object because deserialization will work only with
+	 *                   the mentioned types.
 	 */
 	@JsonCreator
@@ -85,6 +85,6 @@
 	/**
 	 * 
-	 * @return a HashMap<String,Object> containing initialization parameters
-	 *         that can be used by the party.
+	 * @return a {@link HashMap}&lt;String,Object&gt; containing initialization
+	 *         parameters that can be used by the party.
 	 */
 	public HashMap<String, Object> getParameters() {
Index: /events/src/test/java/actions/VotesTest.java
===================================================================
--- /events/src/test/java/actions/VotesTest.java	(revision 23)
+++ /events/src/test/java/actions/VotesTest.java	(revision 24)
@@ -94,9 +94,46 @@
 
 	@Test
-	public void isExtendingTestLessPower() {
-		Vote powervoteA1 = new Vote(partyA, bid1, 3, 9);
-		Votes powerVotes = new Votes(partyA, Arrays.asList(powervoteA1));
-		assertFalse(powerVotes.isExtending(votes1));
-		assertTrue(votes1.isExtending(powerVotes));
+	public void isExtendingIdenticalVotes() {
+		assertTrue(votes1.isExtending(votes1));
+	}
+
+	@Test
+	public void isReallyExtendingVotesMin() {
+		Vote powervoteA1 = new Vote(partyA, bid1, 1, 9);
+		Votes powerVotes = new Votes(partyA,
+				Arrays.asList(powervoteA1, voteA2));
+		assertTrue(powerVotes.isExtending(votes1));
+	}
+
+	@Test
+	public void isReallyExtendingVotesMax() {
+		Vote powervoteA1 = new Vote(partyA, bid1, 2, 10);
+		Votes powerVotes = new Votes(partyA,
+				Arrays.asList(powervoteA1, voteA2));
+		assertTrue(powerVotes.isExtending(votes1));
+	}
+
+	@Test
+	public void IsNarrowingOneVoteRemoved() {
+		Votes narrowVotes = new Votes(partyA, Arrays.asList(voteA2));
+		assertFalse(narrowVotes.isExtending(votes1));
+	}
+
+	@Test
+	public void isNarrowingTestMoreMinPower() {
+		Vote narrowVoteA1 = new Vote(partyA, bid1, 3, 9);
+		Votes narrowVotes = new Votes(partyA,
+				Arrays.asList(narrowVoteA1, voteA2));
+		assertFalse(narrowVotes.isExtending(votes1));
+		assertTrue(votes1.isExtending(narrowVotes));
+	}
+
+	@Test
+	public void isNarrowingLessMaxPower() {
+		Vote powervoteA1 = new Vote(partyA, bid1, 2, 8);
+		Votes narrowVotes = new Votes(partyA,
+				Arrays.asList(powervoteA1, voteA2));
+		assertFalse(narrowVotes.isExtending(votes1));
+		assertTrue(votes1.isExtending(narrowVotes));
 	}
 
Index: /exampleparties/anac2019/agentgg/pom.xml
===================================================================
--- /exampleparties/anac2019/agentgg/pom.xml	(revision 23)
+++ /exampleparties/anac2019/agentgg/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties.anac2019</groupId>
 	<artifactId>agentgg</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -192,5 +192,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -199,8 +199,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/ImpMap.java
===================================================================
--- /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/ImpMap.java	(revision 23)
+++ /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/ImpMap.java	(revision 24)
@@ -63,5 +63,5 @@
 	 * "weight sum" and "number of times" in the import table.
 	 * 
-	 * @param bids a list of ordered bids, worst bid first, best bid last
+	 * @param bidOrdering a list of ordered bids, worst bid first, best bid last
 	 */
 	public void self_update(List<Bid> bidOrdering) {
@@ -116,5 +116,5 @@
 	 * @param bid the bid to get the importance (utility?) of.
 	 * @return the importance value of bid. Note, this this returns possibly
-	 *         large (>1) values, as the importance is not normalized.
+	 *         large (&gt;1) values, as the importance is not normalized.
 	 */
 	public double getImportance(Bid bid) {
Index: /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/SimpleLinearOrdering.java
===================================================================
--- /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/SimpleLinearOrdering.java	(revision 23)
+++ /exampleparties/anac2019/agentgg/src/main/java/geniusweb/exampleparties/agentgg/SimpleLinearOrdering.java	(revision 24)
@@ -67,5 +67,5 @@
 	/**
 	 * 
-	 * @param bid
+	 * @param bid a {@link Bid}
 	 * @return true iff bid is contained in this ordering
 	 */
Index: /exampleparties/anac2019/agentgg/src/test/java/geniusweb/exampleparties/agentgg/AgentGGTest.java
===================================================================
--- /exampleparties/anac2019/agentgg/src/test/java/geniusweb/exampleparties/agentgg/AgentGGTest.java	(revision 23)
+++ /exampleparties/anac2019/agentgg/src/test/java/geniusweb/exampleparties/agentgg/AgentGGTest.java	(revision 24)
@@ -35,4 +35,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -180,8 +181,11 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /exampleparties/anac2019/winkyagent/pom.xml
===================================================================
--- /exampleparties/anac2019/winkyagent/pom.xml	(revision 23)
+++ /exampleparties/anac2019/winkyagent/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties.anac2019</groupId>
 	<artifactId>winkyagent</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -192,5 +192,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -199,8 +199,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/anac2019/winkyagent/src/main/java/geniusweb/exampleparties/anac2019/winkyagent/SimpleLinearOrdering.java
===================================================================
--- /exampleparties/anac2019/winkyagent/src/main/java/geniusweb/exampleparties/anac2019/winkyagent/SimpleLinearOrdering.java	(revision 23)
+++ /exampleparties/anac2019/winkyagent/src/main/java/geniusweb/exampleparties/anac2019/winkyagent/SimpleLinearOrdering.java	(revision 24)
@@ -29,5 +29,5 @@
 	/**
 	 * 
-	 * @param domain
+	 * @param domain the {@link Domain}
 	 * @param bids   a list of bids, ordered from lowest to highest util. The
 	 *               first bid will have utility 0, the last utility 1. If only
@@ -67,5 +67,5 @@
 	/**
 	 * 
-	 * @param bid
+	 * @param bid the {@link Bid}
 	 * @return true iff bid is contained in this ordering
 	 */
@@ -84,5 +84,5 @@
 	/**
 	 * 
-	 * @param profile
+	 * @param profile the {@link Profile}
 	 * @return a list of bids in the profile sorted from low to high utility.
 	 */
Index: /exampleparties/anac2019/winkyagent/src/test/java/geniusweb/exampleparties/anac2019/winkyagent/WinkyAgentTest.java
===================================================================
--- /exampleparties/anac2019/winkyagent/src/test/java/geniusweb/exampleparties/anac2019/winkyagent/WinkyAgentTest.java	(revision 23)
+++ /exampleparties/anac2019/winkyagent/src/test/java/geniusweb/exampleparties/anac2019/winkyagent/WinkyAgentTest.java	(revision 24)
@@ -35,4 +35,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -174,8 +175,11 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /exampleparties/boulware/pom.xml
===================================================================
--- /exampleparties/boulware/pom.xml	(revision 23)
+++ /exampleparties/boulware/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>boulware</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -105,5 +105,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -112,8 +112,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/comparebids/pom.xml
===================================================================
--- /exampleparties/comparebids/pom.xml	(revision 23)
+++ /exampleparties/comparebids/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>comparebids</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -195,8 +195,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/conceder/pom.xml
===================================================================
--- /exampleparties/conceder/pom.xml	(revision 23)
+++ /exampleparties/conceder/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>conceder</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -105,5 +105,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -112,8 +112,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/hardliner/pom.xml
===================================================================
--- /exampleparties/hardliner/pom.xml	(revision 23)
+++ /exampleparties/hardliner/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>hardliner</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -105,5 +105,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -112,8 +112,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/humangui/pom.xml
===================================================================
--- /exampleparties/humangui/pom.xml	(revision 23)
+++ /exampleparties/humangui/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>humangui</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -182,5 +182,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -189,8 +189,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/humangui/src/main/java/geniusweb/exampleparties/humangui/BiddingInfo.java
===================================================================
--- /exampleparties/humangui/src/main/java/geniusweb/exampleparties/humangui/BiddingInfo.java	(revision 23)
+++ /exampleparties/humangui/src/main/java/geniusweb/exampleparties/humangui/BiddingInfo.java	(revision 24)
@@ -32,5 +32,5 @@
  * <li>{@link Bid} if user changed his prepared bid (but did not yet offer it)
  * <li>{@link Profile} if the profile was changed
- * <li>{@Link Boolean} if the isMyTurn value changed.
+ * <li>{@link Boolean} if the isMyTurn value changed.
  * </ul>
  */
@@ -57,5 +57,6 @@
 	 * @param reporter   the {@link Reporter} where we can log issues.
 	 * @param profileint the {@link ProfileInterface}
-	 * @throws Exception if we can not reach the protocol server
+	 * @throws IOException         if we can not reach the protocol server
+	 * @throws DeploymentException if we can not reach the protocol server
 	 */
 	public BiddingInfo(Settings settings,
@@ -97,6 +98,4 @@
 	 * 
 	 * @param action the action to execute.
-	 * @throws IOException           if action can not be sent.
-	 * @throws IllegalStateException if isMyTurn is false.
 	 */
 	public void doAction(Action action) {
Index: /exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/HumanGuiTest.java
===================================================================
--- /exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/HumanGuiTest.java	(revision 23)
+++ /exampleparties/humangui/src/test/java/geniusweb/exampleparties/humangui/HumanGuiTest.java	(revision 24)
@@ -6,4 +6,5 @@
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
@@ -28,4 +29,5 @@
 import geniusweb.bidspace.AllBidsList;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Settings;
@@ -76,5 +78,7 @@
 	@After
 	public void after() {
-		party.notifyChange(new Finished(null));
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 	}
 
Index: /exampleparties/linear/pom.xml
===================================================================
--- /exampleparties/linear/pom.xml	(revision 23)
+++ /exampleparties/linear/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>linear</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -104,5 +104,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -111,8 +111,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/randomparty/pom.xml
===================================================================
--- /exampleparties/randomparty/pom.xml	(revision 23)
+++ /exampleparties/randomparty/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>randomparty</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -187,5 +187,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -194,8 +194,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java
===================================================================
--- /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java	(revision 23)
+++ /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java	(revision 24)
@@ -40,5 +40,6 @@
  * with sufficient utility.
  * <h2>parameters</h2>
- * <table>
+ * <table >
+ * <caption>parameters</caption>
  * <tr>
  * <td>minPower</td>
Index: /exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java
===================================================================
--- /exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java	(revision 23)
+++ /exampleparties/randomparty/src/test/java/geniusweb/exampleparties/randomparty/RandomPartyTest.java	(revision 24)
@@ -8,4 +8,5 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
@@ -38,4 +39,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -163,8 +165,10 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /exampleparties/randompartypy/pom.xml
===================================================================
--- /exampleparties/randompartypy/pom.xml	(revision 23)
+++ /exampleparties/randompartypy/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>randompyparty</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -166,5 +166,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -173,8 +173,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/simpleboa/pom.xml
===================================================================
--- /exampleparties/simpleboa/pom.xml	(revision 23)
+++ /exampleparties/simpleboa/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>simpleboaparty</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -125,5 +125,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -132,8 +132,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/simpleboa/src/test/java/geniusweb/exampleparties/simpleboa/SimpleBoaTest.java
===================================================================
--- /exampleparties/simpleboa/src/test/java/geniusweb/exampleparties/simpleboa/SimpleBoaTest.java	(revision 23)
+++ /exampleparties/simpleboa/src/test/java/geniusweb/exampleparties/simpleboa/SimpleBoaTest.java	(revision 24)
@@ -37,4 +37,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -164,8 +165,11 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /exampleparties/simpleshaop/pom.xml
===================================================================
--- /exampleparties/simpleshaop/pom.xml	(revision 23)
+++ /exampleparties/simpleshaop/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>simpleshaop</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.6</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -188,5 +188,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -195,8 +195,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/ShaopParty.java
===================================================================
--- /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/ShaopParty.java	(revision 23)
+++ /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/ShaopParty.java	(revision 24)
@@ -38,5 +38,5 @@
  * created.
  * <p>
- * <b>Requirement<b> the initial {@link PartialOrdering} must contain at least
+ * <b>Requirement</b> the initial {@link PartialOrdering} must contain at least
  * the bids with lowest utility and highest utility, and the proper comparison
  * info for these two bids.
Index: /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/SimpleLinearOrdering.java
===================================================================
--- /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/SimpleLinearOrdering.java	(revision 23)
+++ /exampleparties/simpleshaop/src/main/java/geniusweb/exampleparties/simpleshaop/SimpleLinearOrdering.java	(revision 24)
@@ -21,5 +21,8 @@
 
 	private final Domain domain;
-	private final List<Bid> bids; // worst bid first, best bid last.
+	/**
+	 * List of bids. worst bid first, best bid last.
+	 */
+	private final List<Bid> bids;
 
 	SimpleLinearOrdering(Profile profile) {
@@ -29,5 +32,5 @@
 	/**
 	 * 
-	 * @param domain
+	 * @param domain The {@link Domain}
 	 * @param bids   a list of bids, ordered from lowest to highest util. The
 	 *               first bid will have utility 0, the last utility 1. If only
@@ -67,5 +70,5 @@
 	/**
 	 * 
-	 * @param bid
+	 * @param bid the {@link Bid}
 	 * @return true iff bid is contained in this ordering
 	 */
@@ -84,5 +87,5 @@
 	/**
 	 * 
-	 * @param profile
+	 * @param profile the {@link Profile}
 	 * @return a list of bids in the profile sorted from low to high utility.
 	 */
@@ -108,9 +111,9 @@
 
 	/**
-	 * @param bid       a new bid to be inserted
+	 * @param bid       a new {@link Bid} to be inserted
 	 * @param worseBids all bids that are worse than this bid.
-	 * @return a SimpleLinearOrdering, updated with the given comparison. Thee
-	 *         bid will be inserted after the first bid that is not worse than
-	 *         bid.
+	 * @return a {@link SimpleLinearOrdering}, updated with the given
+	 *         comparison. Thee bid will be inserted after the first bid that is
+	 *         not worse than bid.
 	 */
 	public SimpleLinearOrdering with(Bid bid, List<Bid> worseBids) {
Index: /exampleparties/simpleshaop/src/test/java/geniusweb/exampleparties/simpleshaop/ShaopPartyTest.java
===================================================================
--- /exampleparties/simpleshaop/src/test/java/geniusweb/exampleparties/simpleshaop/ShaopPartyTest.java	(revision 23)
+++ /exampleparties/simpleshaop/src/test/java/geniusweb/exampleparties/simpleshaop/ShaopPartyTest.java	(revision 24)
@@ -8,4 +8,5 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
@@ -37,4 +38,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -178,8 +180,11 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /exampleparties/timedependentparty/pom.xml
===================================================================
--- /exampleparties/timedependentparty/pom.xml	(revision 23)
+++ /exampleparties/timedependentparty/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>timedependentparty</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -34,5 +34,5 @@
 			<groupId>geniusweb</groupId>
 			<artifactId>party</artifactId>
-	<version>${geniusweb.version}</version>
+			<version>${geniusweb.version}</version>
 		</dependency>
 
@@ -40,10 +40,10 @@
 			<groupId>geniusweb</groupId>
 			<artifactId>bidspace</artifactId>
-	<version>${geniusweb.version}</version>
+			<version>${geniusweb.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>geniusweb</groupId>
 			<artifactId>profileconnection</artifactId>
-	<version>${geniusweb.version}</version>
+			<version>${geniusweb.version}</version>
 		</dependency>
 		<dependency>
@@ -188,5 +188,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -195,8 +195,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/ExtendedUtilSpace.java
===================================================================
--- /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/ExtendedUtilSpace.java	(revision 23)
+++ /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/ExtendedUtilSpace.java	(revision 24)
@@ -21,5 +21,9 @@
 public class ExtendedUtilSpace {
 	private LinearAdditive utilspace;
-	private BigDecimal tolerance; // utility tolerance for a bid.
+	/**
+	 * The tolerance for a utility. Generally utilities can be this amount
+	 * smaller than requested. See also {@link #computeTolerance()}.
+	 */
+	private BigDecimal tolerance;
 	private BidsWithUtility bidutils;
 	// min and max achievable utility
@@ -92,6 +96,7 @@
 
 	/**
-	 * @param utilityGoal
-	 * @return bids with utility inside [utilitygoal-tolerance, utilitygoal]
+	 * @param utilityGoal the requested utility
+	 * @return bids with utility inside [utilitygoal-{@link #tolerance},
+	 *         utilitygoal]
 	 */
 	public ImmutableList<Bid> getBids(BigDecimal utilityGoal) {
Index: /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java
===================================================================
--- /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java	(revision 23)
+++ /exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java	(revision 24)
@@ -34,5 +34,5 @@
  * brute-force search through the bidspace and can handle bidspace sizes up to
  * 2^31 (approx 1 billion bids). It may take excessive time and run out of time
- * on bidspaces > 10000 bids. In special cases it may even run out of memory,
+ * on bidspaces &gt; 10000 bids. In special cases it may even run out of memory,
  */
 public class TimeDependentParty extends DefaultParty {
@@ -104,9 +104,9 @@
 	 *         behaviour [1]:
 	 * 
-	 *         1. Boulware: For this strategy e < 1 and the initial offer is
+	 *         1. Boulware: For this strategy e &lt; 1 and the initial offer is
 	 *         maintained till time is almost exhausted, when the agent concedes
 	 *         up to its reservation value.
 	 * 
-	 *         2. Conceder: For this strategy e > 1 and the agent goes to its
+	 *         2. Conceder: For this strategy e &gt; 1 and the agent goes to its
 	 *         reservation value very quickly.
 	 * 
Index: /exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java
===================================================================
--- /exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java	(revision 23)
+++ /exampleparties/timedependentparty/src/test/java/geniusweb/exampleparties/timedependentparty/TimeDependentPartyTest.java	(revision 24)
@@ -8,4 +8,5 @@
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
@@ -35,4 +36,5 @@
 import geniusweb.connection.ConnectionEnd;
 import geniusweb.inform.ActionDone;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -181,8 +183,11 @@
 		party.connect(connection);
 		party.notifyChange(settings);
-		party.notifyChange(new Finished(null));
+		Agreements agreements = mock(Agreements.class);
+		when(agreements.toString()).thenReturn("agree");
+
+		party.notifyChange(new Finished(agreements));
 
 		verify(reporter).log(eq(Level.INFO),
-				eq("Final ourcome:Finished[null]"));
+				eq("Final ourcome:Finished[agree]"));
 	}
 
Index: /issuevalue/pom.xml
===================================================================
--- /issuevalue/pom.xml	(revision 23)
+++ /issuevalue/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>issuevalue</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -148,5 +148,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -155,8 +155,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /issuevalue/src/main/java/geniusweb/issuevalue/Bid.java
===================================================================
--- /issuevalue/src/main/java/geniusweb/issuevalue/Bid.java	(revision 23)
+++ /issuevalue/src/main/java/geniusweb/issuevalue/Bid.java	(revision 24)
@@ -56,5 +56,5 @@
 
 	/**
-	 * @param issue
+	 * @param issue name of the issue
 	 * @return the value for the given issue, or null if there is no value for
 	 *         the given issue.
@@ -65,6 +65,5 @@
 
 	/**
-	 * 
-	 * @param issue
+	 * @param issue name of the issue
 	 * @return true iff the bid contains a value for the given issue.
 	 */
Index: /issuevalue/src/main/java/geniusweb/issuevalue/Domain.java
===================================================================
--- /issuevalue/src/main/java/geniusweb/issuevalue/Domain.java	(revision 23)
+++ /issuevalue/src/main/java/geniusweb/issuevalue/Domain.java	(revision 24)
@@ -73,5 +73,5 @@
 	/**
 	 * 
-	 * @param domain the domain to check the bid in
+	 * @param bid a Bid
 	 * @return null if this bid is complete, or an error message explaining why
 	 *         the bid is not complete. Complete means that the bid contains a
Index: /issuevalue/src/main/java/geniusweb/issuevalue/ValueSet.java
===================================================================
--- /issuevalue/src/main/java/geniusweb/issuevalue/ValueSet.java	(revision 23)
+++ /issuevalue/src/main/java/geniusweb/issuevalue/ValueSet.java	(revision 24)
@@ -17,8 +17,8 @@
  * by a String)).
  * 
- * @param <T> type of objects in this value set. We do not implement ValueSet
- *        right away because types are lost at runtime. Implementing separate
- *        classes for implementing the ValueSet ensures we can get back the type
- *        at runtime. immutable. Thread safe.
+ * Value is the type of objects in this value set. We do not implement ValueSet
+ * right away because types are lost at runtime. Implementing separate classes
+ * for implementing the ValueSet ensures we can get back the type at runtime.
+ * immutable. Thread safe.
  */
 @JsonDeserialize(using = ValueSetDeserializer.class)
@@ -62,5 +62,6 @@
 			return codec.treeToValue(node, DiscreteValueSet.class);
 		}
-		throw new IllegalArgumentException("Expected 'range' or 'values' property for ValueSet contents");
+		throw new IllegalArgumentException(
+				"Expected 'range' or 'values' property for ValueSet contents");
 	}
 
Index: /opponentmodel/pom.xml
===================================================================
--- /opponentmodel/pom.xml	(revision 23)
+++ /opponentmodel/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>opponentmodel</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -167,5 +167,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -174,8 +174,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /opponentmodel/src/main/java/geniusweb/opponentmodel/OpponentModel.java
===================================================================
--- /opponentmodel/src/main/java/geniusweb/opponentmodel/OpponentModel.java	(revision 23)
+++ /opponentmodel/src/main/java/geniusweb/opponentmodel/OpponentModel.java	(revision 24)
@@ -37,6 +37,6 @@
 	/**
 	 * Update this with a new action that was done by the opponent that this
-	 * model is modeling. {@link #with(Domain)} must be called before calling
-	 * this.
+	 * model is modeling. {@link #with(Domain, Bid)} must be called before
+	 * calling this.
 	 * 
 	 * @param action   the new incoming action.
Index: /party/pom.xml
===================================================================
--- /party/pom.xml	(revision 23)
+++ /party/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>party</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -173,5 +173,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -180,8 +180,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /party/src/main/java/geniusweb/party/Capabilities.java
===================================================================
--- /party/src/main/java/geniusweb/party/Capabilities.java	(revision 23)
+++ /party/src/main/java/geniusweb/party/Capabilities.java	(revision 24)
@@ -14,5 +14,5 @@
 public class Capabilities {
 	/**
-	 * List of supported protocols
+	 * List of supported protocol names
 	 */
 	private final Set<String> behaviours;
@@ -20,5 +20,5 @@
 	/**
 	 * 
-	 * @param protocols the protocols that a Party can handle
+	 * @param behaviours the protocols that a Party can handle
 	 */
 	@JsonCreator
Index: /party/src/test/java/geniusweb/party/inform/FinishedTest.java
===================================================================
--- /party/src/test/java/geniusweb/party/inform/FinishedTest.java	(revision 23)
+++ /party/src/test/java/geniusweb/party/inform/FinishedTest.java	(revision 24)
@@ -89,5 +89,5 @@
 	}
 
-	@Test
+	@Test(expected = NullPointerException.class)
 	public void nullTest() throws URISyntaxException {
 		new Finished(null);
Index: /profile/pom.xml
===================================================================
--- /profile/pom.xml	(revision 23)
+++ /profile/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>profile</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -157,5 +157,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -164,8 +164,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /profile/src/main/java/geniusweb/profile/DefaultPartialOrdering.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/DefaultPartialOrdering.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/DefaultPartialOrdering.java	(revision 24)
@@ -37,8 +37,10 @@
 	/**
 	 * 
-	 * @param name
-	 * @param domain
-	 * @param reservationbid
-	 * @param bids
+	 * @param name           name of the profile
+	 * @param domain         the {@link Domain}
+	 * @param reservationbid the reservation bid, this is the minimum acceptable
+	 *                       bid
+	 * @param bids           a list of bids that this ordering contains
+	 *                       comparisons for
 	 * @param isbetterList   a list of tuples [bid1index, bid2index]. It
 	 *                       indicates that bids[bid1index] isbetterthan
Index: /profile/src/main/java/geniusweb/profile/FullOrdering.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/FullOrdering.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/FullOrdering.java	(revision 24)
@@ -11,13 +11,17 @@
 	 * @param bid1 the first item's utility/preference
 	 * @param bid2 the second item's utility/preference
-	 * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In all
-	 *         other cases false is returned.
+	 * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In
+	 *         all other cases false is returned.
 	 * 
 	 *         This predicate should be implemented such that
+	 *         <ul>
 	 *         <li>For all b1 and b2, either b1 &ge; b2 or b2 &ge; b1.
 	 *         <li>b &ge; b (every bid is better or equal to itself)
-	 *         <li>If b1&ge;b2 and b2&ge;b1 then the two bids are considered equally
-	 *         good. Note that this differes from a partial order in mathematics.
-	 *         <li>it behaves transitive: if b1&ge;b2 and b2&ge;b3 then b1&ge;b3.
+	 *         <li>If b1&ge;b2 and b2&ge;b1 then the two bids are considered
+	 *         equally good. Note that this differes from a partial order in
+	 *         mathematics.
+	 *         <li>it behaves transitive: if b1&ge;b2 and b2&ge;b3 then
+	 *         b1&ge;b3.
+	 *         </ul>
 	 */
 	@Override
Index: /profile/src/main/java/geniusweb/profile/PartialOrdering.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/PartialOrdering.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/PartialOrdering.java	(revision 24)
@@ -13,13 +13,17 @@
 	 * @param bid1 the first item's utility/preference
 	 * @param bid2 the second item's utility/preference
-	 * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In all
-	 *         other cases false is returned. A bid may not have a &ge; relation at
-	 *         all.
+	 * @return true iff bid1 is considered better or equal (&ge;) than bid 2. In
+	 *         all other cases false is returned. A bid may not have a &ge;
+	 *         relation at all.
 	 * 
 	 *         This predicate should be implemented such that
+	 *         <ul>
 	 *         <li>b &ge; b (every bid is better or equal to itself)
-	 *         <li>If b1&ge;b2 and b2&ge;b1 then the two bids are considered equally
-	 *         good. Note that this differes from a partial order in mathematics.
-	 *         <li>it behaves transitive: if b1&ge;b2 and b2&ge;b3 then b1&ge;b3.
+	 *         <li>If b1&ge;b2 and b2&ge;b1 then the two bids are considered
+	 *         equally good. Note that this differes from a partial order in
+	 *         mathematics.
+	 *         <li>it behaves transitive: if b1&ge;b2 and b2&ge;b3 then
+	 *         b1&ge;b3.
+	 *         </ul>
 	 */
 	boolean isPreferredOrEqual(Bid bid1, Bid bid2);
Index: /profile/src/main/java/geniusweb/profile/Profile.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/Profile.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/Profile.java	(revision 24)
@@ -36,10 +36,9 @@
 	 * 
 	 * @return a (hypothetical) bid that is the best alternative to a
-	 *         non-agreement. Only bids that are
-	 *         {@link #isPreferredOrEqual(Bid, Bid)} should be accepted. If a
-	 *         negotiation does not reach an agreement, the party can get this
-	 *         offer somewhere else. This replaces the older notion of a
-	 *         "reservation value" and is more general. If null, there is no
-	 *         reservation bid and any agreement is better than no agreement.
+	 *         non-agreement. Only bids that are equal or better should be
+	 *         accepted. If a negotiation does not reach an agreement, the party
+	 *         can get this offer somewhere else. This replaces the older notion
+	 *         of a "reservation value" and is more general. If null, there is
+	 *         no reservation bid and any agreement is better than no agreement.
 	 * 
 	 */
Index: /profile/src/main/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilities.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilities.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilities.java	(revision 24)
@@ -20,6 +20,8 @@
  * issue so may need further checking when used for an actual issue. Constructor
  * guarantees that
+ * <ul>
  * <li>All values in the provided map (the utilities) are in [0,1]
  * <li>All keys are proper {@link DiscreteValue}s
+ * </ul>
  */
 @JsonTypeName("discreteutils")
Index: /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditive.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditive.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditive.java	(revision 24)
@@ -22,5 +22,5 @@
 	/**
 	 * 
-	 * @param issue
+	 * @param issue the issue name
 	 * @return the weight of the given issue
 	 */
Index: /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/LinearAdditiveUtilitySpace.java	(revision 24)
@@ -20,7 +20,9 @@
  * 
  * Constructor guarantees that
+ * <ul>
  * <li>weights are normalized to 1
  * <li>the issues in the utility map and weights map match those in the domain
  * <li>The utilities for each issue are proper {@link ValueSetUtilities} objects
+ * </ul>
  */
 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
Index: /profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/NumberValueSetUtilities.java	(revision 24)
@@ -40,5 +40,5 @@
 	 * @param lowUtility  the utility of the {@link #lowValue}
 	 * @param highValue   the high value of the {@link Range}. Must be
-	 *                    >lowValue.
+	 *                    &gt;lowValue.
 	 * @param highUtility the utility of the {@link #highValue}
 	 */
Index: /profile/src/main/java/geniusweb/profile/utilityspace/PartsUtilities.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/PartsUtilities.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/PartsUtilities.java	(revision 24)
@@ -19,7 +19,7 @@
 /**
  * Contains utilities of a ProductOfValue of a {@link SumOfGroupsUtilitySpace}.
- * So this is similar to a DiscreteValueSetUtilities but instead of issues this
- * contains an (ordered) list of issues. This object serializes to something
- * like <code> 
+ * So this is similar to a {@link DiscreteValueSetUtilities} but instead of
+ * issues this contains an (ordered) list of issues. This object serializes to
+ * something like <code> 
  * {"partsutils":
  * {"issues":["issue1","issue2"],
@@ -29,5 +29,4 @@
  * N issue values, in the same order as the issues list and with "util"
  * containng the utility value of that set of values.
- * <p>
  */
 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
@@ -43,5 +42,5 @@
 	/**
 	 * 
-	 * @param issues
+	 * @param issues list of issues
 	 * @param utils  with keys: list of values and value: utility value for that
 	 *               list of values. All list-of-values missing from the map are
Index: /profile/src/main/java/geniusweb/profile/utilityspace/ProductOfValue.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/ProductOfValue.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/ProductOfValue.java	(revision 24)
@@ -19,5 +19,5 @@
 
 	/**
-	 * @param values the values to make a product of
+	 * @param newvals the values to make a product of
 	 */
 	@JsonCreator
Index: /profile/src/main/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpace.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpace.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpace.java	(revision 24)
@@ -47,18 +47,15 @@
 
 	/**
-	 * @param domain  the {@link Domain} in which this profile is defined.
-	 * @param name    the name of this profile. Must be simple name (a-Z, 0-9)
-	 * @param utils   a map with key: part names (String) and value: the
-	 *                {@link PartsUtilities} for that part. There MUST NOT be a
-	 *                null part name. All values MUST NOT be null. The
-	 *                PartsUtilities must match the
-	 * @param weights the weight of each part, for the computation of the
-	 *                weighted sum. The parts must be the same as those in the
-	 *                utils map. All weights MUST NOT be null. The weights MUST
-	 *                sum to 1.
-	 * @param resBid  the reservation bid. Only bids that are
-	 *                {@link #isPreferredOrEqual(Bid, Bid)} should be accepted.
-	 *                Can be null, meaning that there is no reservation bid and
-	 *                any agreement is better than no agreement.
+	 * @param domain    the {@link Domain} in which this profile is defined.
+	 * @param name      the name of this profile. Must be simple name (a-Z, 0-9)
+	 * @param partutils a map with key: part names (String) and value: the
+	 *                  {@link PartsUtilities} for that part. There MUST NOT be
+	 *                  a null part name. All values MUST NOT be null. The
+	 *                  PartsUtilities must match the
+	 * @param resBid    the reservation bid. Only bids that are
+	 *                  {@link #isPreferredOrEqual(Bid, Bid)} should be
+	 *                  accepted. Can be null, meaning that there is no
+	 *                  reservation bid and any agreement is better than no
+	 *                  agreement.
 	 * @throws NullPointerException     if values are incorrectly null.
 	 * @throws IllegalArgumentException if preconditions not met.
@@ -68,5 +65,4 @@
 			@JsonProperty("name") String name,
 			@JsonProperty("partUtilities") HashMap<String, PartsUtilities> partutils,
-			// @JsonProperty("partWeights") Map<String, BigDecimal> weights,
 			@JsonProperty("reservationBid") Bid resBid) {
 		super(name, domain, resBid);
Index: /profile/src/main/java/geniusweb/profile/utilityspace/ValueSetUtilities.java
===================================================================
--- /profile/src/main/java/geniusweb/profile/utilityspace/ValueSetUtilities.java	(revision 23)
+++ /profile/src/main/java/geniusweb/profile/utilityspace/ValueSetUtilities.java	(revision 24)
@@ -5,9 +5,8 @@
 import com.fasterxml.jackson.annotation.JsonSubTypes;
 import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
 
 import geniusweb.issuevalue.Value;
 import geniusweb.issuevalue.ValueSet;
-
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
 
 /**
@@ -16,11 +15,12 @@
  */
 @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
-@JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class), @Type(value = NumberValueSetUtilities.class) })
+@JsonSubTypes({ @Type(value = DiscreteValueSetUtilities.class),
+		@Type(value = NumberValueSetUtilities.class) })
 public interface ValueSetUtilities {
 	/**
 	 * 
-	 * @param value
-	 * @return the utility of the given value. MUST be in [0,1]. Should return 0 if
-	 *         the value is unknown.
+	 * @param value the {@link Value} to get the utility for
+	 * @return the utility of the given value. MUST be in [0,1]. Should return 0
+	 *         if the value is unknown.
 	 */
 	BigDecimal getUtility(Value value);
@@ -28,8 +28,8 @@
 	/**
 	 * 
-	 * @param values the valueset that
+	 * @param valueset the valueset that is supposed match with this
 	 * @return null if the ValueSetUtilities fits the given set of values , that
-	 *         means it can give utilities for all possible values in valueset. Or a
-	 *         string containing an explanation why not.
+	 *         means it can give utilities for all possible values in valueset.
+	 *         Or a string containing an explanation why not.
 	 */
 	String isFitting(ValueSet valueset);
Index: /profileconnection/pom.xml
===================================================================
--- /profileconnection/pom.xml	(revision 23)
+++ /profileconnection/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>profileconnection</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -162,5 +162,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -169,8 +169,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /profileconnection/src/main/java/geniusweb/profileconnection/ProfileConnectionFactory.java
===================================================================
--- /profileconnection/src/main/java/geniusweb/profileconnection/ProfileConnectionFactory.java	(revision 23)
+++ /profileconnection/src/main/java/geniusweb/profileconnection/ProfileConnectionFactory.java	(revision 24)
@@ -17,7 +17,10 @@
 
 	/**
-	 * @uri the URI that can provide the {@link Profile}. Support both the ws
-	 *      and the file scheme for the uri.
+	 * @param uri      the URI that can provide the {@link Profile}. Support
+	 *                 both the ws and the file scheme for the uri.
 	 * @param reporter the {@link Reporter} to log issues to
+	 * @return a {@link ProfileInterface}
+	 * @throws IOException         if connection can't be made
+	 * @throws DeploymentException if endpoint can't be published
 	 */
 	public static ProfileInterface create(URI uri, Reporter reporter)
Index: /profileconnection/src/main/java/geniusweb/profileconnection/ProfileInterface.java
===================================================================
--- /profileconnection/src/main/java/geniusweb/profileconnection/ProfileInterface.java	(revision 23)
+++ /profileconnection/src/main/java/geniusweb/profileconnection/ProfileInterface.java	(revision 24)
@@ -14,6 +14,7 @@
 	 * @return the latest version of the profile. May change at any time, after
 	 *         someone updates the version on the server. Call to this may block
-	 *         for limited time if the profile is not yet available. 
-	 *         @throws IOException if profile can not be fetched	 */
+	 *         for limited time if the profile is not yet available.
+	 * @throws IOException if profile can not be fetched
+	 */
 	public Profile getProfile() throws IOException;
 }
Index: /profileconnection/src/main/java/geniusweb/profileconnection/WebsocketProfileConnector.java
===================================================================
--- /profileconnection/src/main/java/geniusweb/profileconnection/WebsocketProfileConnector.java	(revision 23)
+++ /profileconnection/src/main/java/geniusweb/profileconnection/WebsocketProfileConnector.java	(revision 24)
@@ -37,6 +37,10 @@
 	 *                    websockets. Typically ContainerProvider
 	 *                    .getWebSocketContainer()
-	 * @throws DeploymentException
-	 * @throws IOException
+	 * @throws DeploymentException if the annotated endpoint instance is not
+	 *                             valid
+	 * @throws IOException         if there was a network or protocol problem
+	 *                             that prevented the client endpoint being
+	 *                             connected to its server.
+	 * 
 	 */
 	public WebsocketProfileConnector(URI uri, Reporter reporter,
Index: /protocol/pom.xml
===================================================================
--- /protocol/pom.xml	(revision 23)
+++ /protocol/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>protocol</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -28,5 +28,5 @@
 
 	<dependencies>
-			<dependency>
+		<dependency>
 			<groupId>geniusweb</groupId>
 			<artifactId>issuevalue</artifactId>
@@ -43,10 +43,5 @@
 			<version>${geniusweb.version}</version>
 		</dependency>
-<!-- 		<dependency>
-			<groupId>geniusweb</groupId>
-			<artifactId>party</artifactId>
-			<version>${geniusweb.version}</version>
-		</dependency>
- -->		<dependency>
+		<dependency>
 			<groupId>geniusweb</groupId>
 			<artifactId>references</artifactId>
@@ -191,5 +186,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -198,8 +193,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /protocol/src/main/java/geniusweb/protocol/NegoProtocol.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/NegoProtocol.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/NegoProtocol.java	(revision 24)
@@ -13,5 +13,4 @@
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
 import geniusweb.protocol.session.SessionProtocol;
-import geniusweb.protocol.session.SessionSettings;
 import geniusweb.protocol.session.SessionState;
 import geniusweb.protocol.tournament.TournamentProtocol;
@@ -30,8 +29,8 @@
  * 
  * A protocol is mutable because the incoming connections cause state changes.
- * But it is recommended to push all changing properties into the state.
+ * But it is recommended to push changing properties into the state so that the
+ * complete state can be recovered and analysed.
  * <p>
  * Because a protocol contains an internal state, it can be used only once.
- * <p>
  * <p>
  * The protocol can emit a {@link CurrentState} event at any time. It should do
@@ -42,5 +41,5 @@
  * which it can resolve received {@link Reference}s. <br>
  * First call to instances <b>must be</b>
- * {@link #start(SessionSettings, ConnectionFactory)}.
+ * {@link #start(ProtocolToPartyConnFactory)}.
  * 
  * <h2>Ensure time deadline</h2>
@@ -48,6 +47,4 @@
  * The protocol also needs to keep an eye on the deadline and take appropriate
  * actions when the deadline is reached. <br>
- * A protocol should emit a {@link SessionEnded} or {@link TournamentEnded}
- * event when it is finished.
  * <p>
  * All protocol implementations must ensure that the deadline is kept and that
@@ -73,6 +70,7 @@
 	 * <p>
 	 * 
-	 * All errors are to be handled through {@link SessionState#getError()}
-	 * except for plain {@link IllegalArgumentException}s. <br>
+	 * All errors are to be handled through {@link SessionState#getResult()}
+	 * except for bugs that use {@link RuntimeException} like
+	 * {@link IllegalArgumentException}s. <br>
 	 * The protocol usually uses the incoming connections to keep running. It
 	 * does not need to run in a separate thread or so.
Index: /protocol/src/main/java/geniusweb/protocol/NegoState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/NegoState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/NegoState.java	(revision 24)
@@ -11,6 +11,11 @@
 
 /**
- * The current state of the session/tournament. Must be serializabl;e so that it
- * can be restarted if a crash occurs.
+ * The current state of the session/tournament. Must be (de)serializabl;e so
+ * that it can be restarted if a crash occurs. Notice that this restart
+ * functionality is not yet available.
+ * <p>
+ * In general the state contains all the information to control the flow of the
+ * negotiation: who did what, are we finished, etc. This object may be stored to
+ * record the final result as well
  */
 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
Index: /protocol/src/main/java/geniusweb/protocol/ProtocolException.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/ProtocolException.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/ProtocolException.java	(revision 24)
@@ -5,6 +5,5 @@
 
 /**
- * thrown if a {@link Party} violates the protocols (that includes
- * disconnecting).
+ * thrown if a Party violates the protocols (that includes disconnecting).
  */
 public class ProtocolException extends Exception {
Index: /protocol/src/main/java/geniusweb/protocol/partyconnection/ProtocolToPartyConnections.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/partyconnection/ProtocolToPartyConnections.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/partyconnection/ProtocolToPartyConnections.java	(revision 24)
@@ -49,7 +49,11 @@
 
 	/**
-	 * Broadcast info to all parties
+	 * Broadcast info to all parties. Notice that the broadcast immediately
+	 * aborts if an error occurs and remaining parties will not receive the
+	 * event. Therefore it is recommended to instead send to all parties
+	 * individually to ensure all parties are handled individually.
 	 * 
 	 * @param info the {@link Inform} to broadcast
+	 * @throws IOException if the send fails.
 	 */
 	public void broadcast(Inform info) throws IOException {
@@ -68,5 +72,5 @@
 
 	/**
-	 * @param i
+	 * @param i the connection number
 	 * @return the ith connection
 	 */
Index: /protocol/src/main/java/geniusweb/protocol/session/SessionResult.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/SessionResult.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/SessionResult.java	(revision 24)
@@ -67,6 +67,6 @@
 
 	/**
-	 * 8return the final {@link Agreements} of the session. May be empty, not
-	 * null
+	 * @return the final {@link Agreements} of the session. May be empty, not
+	 *         null
 	 */
 	public Agreements getAgreements() {
Index: /protocol/src/main/java/geniusweb/protocol/session/SessionState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/SessionState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/SessionState.java	(revision 24)
@@ -18,15 +18,9 @@
  * and the parties currently connected. <br>
  * The state checks if transitions (Actions from the party) are following the
- * protocol, and thus implement most of the protocol . See
- * {@link #with(geniusweb.actions.PartyId, Action)}. <br>
- * 
- * Use {@link #with(geniusweb.actions.PartyId, Action)} and
- * {@link #with(geniusweb.actions.PartyId, tudelft.utilities.connection.Connection)}
- * to create a new state <br>
- * 
+ * protocol, and thus implement most of the protocol . <br>
  * 
  * If protocol errors occur, these should be stored in the state and the state
- * should become {@link #isFinal()}. Throwing should happen only in case of a
- * bug.<br>
+ * should become {@link #isFinal(long)}. Throwing should happen only in case of
+ * a bug.<br>
  * 
  * Implementations should be immutable (to ensure thread safety, testability
@@ -66,5 +60,5 @@
 	 * @return the current standing agreement, or null if there is no agreement
 	 *         at this point. An agreement does not necessarily mean
-	 *         {@link #isFinal()}.
+	 *         {@link #isFinal(long)}.
 	 */
 	Agreements getAgreements();
@@ -72,6 +66,7 @@
 	/**
 	 * 
-	 * @return the {@link SessionResult}. Assumes {@link #isFinal(long)}. result
-	 *         may be undefined if not.
+	 * @return the {@link SessionResult} which is a short report of the final
+	 *         outcome. Assumes {@link #isFinal(long)}. result may be undefined
+	 *         if not.
 	 */
 	SessionResult getResult();
Index: /protocol/src/main/java/geniusweb/protocol/session/amop/AMOP.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/amop/AMOP.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/amop/AMOP.java	(revision 24)
@@ -28,5 +28,4 @@
 import geniusweb.protocol.CurrentNegoState;
 import geniusweb.protocol.ProtocolException;
-import geniusweb.protocol.WillBeCalled;
 import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
@@ -51,26 +50,28 @@
  * <h1>parameter</h1> AMOP parties can receive a parameter: minVotes containing
  * a Double. If set, the AMOP protocol checks that all {@link Votes} from that
- * party have {@link Vote#getMinPower()} > minVotes.
- * <h1>Protocol steps</h1> The protocol tries to start all parties. If not all
- * parties start, the parties are freed up and another attempt is done to start
- * all parties some time later.
+ * party have {@link Vote#getMinPower()} &gt; minVotes.
+ * <h1>Protocol steps</h1>
+ * <ol>
+ * <li>The protocol tries to start all parties. If not all parties start, the
+ * parties are freed up and another attempt is done to start all parties some
+ * time later.
  * <li>the variable remainingparties = {all parties}
  * <li>The session deadline clock now starts ticking.
  * <li>All parties are sent their settings.
- * <li>Loop until {@link Deadline} is reached or |remainingparties|<2:
+ * <li>Loop until {@link Deadline} is reached or |remainingparties|&lt;2:
  * <ol>
  * <li>protocol sends {@link YourTurn} to all remainingparties. Each party now
  * must submit an {@link Offer} within {@link #PHASE_TIME} seconds. If a party
  * fails to submit it is send Finished and removed from from remainingparties.
- * <li>protocol sends a {@link Voting} containing a List<Bid> containing all
- * received {@link Bid}s. Each party must place his {@link Votes} within
- * {@link #PHASE_TIME} seconds. If a party does not submit, it is send a
+ * <li>protocol sends a {@link Voting} containing a List of {@link Bid}
+ * containing all received {@link Bid}s. Each party must place his {@link Votes}
+ * within {@link #PHASE_TIME} seconds. If a party does not submit, it is send a
  * {@link Finished} and removed from remainingparties. Previous votes for the
  * same bid do not count. But see {@link Agreements}.
- * <li>The protocol determines a maximum sized subset of size N>=2 of the votes
- * for bid B for which the vote conditions hold. If there is such a subset, the
- * parties that placed these votes reached an agreement. They are added to the
- * agreement set, sent the {@link Finished} info and terminated. They are
- * removed from the remainingparties.
+ * <li>The protocol determines a maximum sized subset of size N&ge;2 of the
+ * votes for bid B for which the vote conditions hold. If there is such a
+ * subset, the parties that placed these votes reached an agreement. They are
+ * added to the agreement set, sent the {@link Finished} info and terminated.
+ * They are removed from the remainingparties.
  * </ol>
  * <li>Any remaining parties are sent a {@link Finished} object without
@@ -109,5 +110,6 @@
 	/**
 	 * 
-	 * @param state normally the initial state coming from SAOPSettings
+	 * @param state  normally the initial state coming from SAOPSettings
+	 * @param logger the {@link Reporter} to use
 	 */
 	public AMOP(AMOPState state, Reporter logger) {
@@ -218,6 +220,6 @@
 	 * overridable factory method, used for testing.
 	 * 
-	 * @param r
-	 * @param delayMs
+	 * @param r       the {@link Runnable} that will be called
+	 * @param delayMs the time after which r will be called
 	 * @return new WillBeCalled(r,delayms)
 	 */
Index: /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPSettings.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPSettings.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPSettings.java	(revision 24)
@@ -30,6 +30,5 @@
 	 *                     protocol. But SAOP can be initialized with less, for
 	 *                     use in TournamentSettings.
-	 * @param deadline
-	 * @param minimumVotes the minimum number of votes allowed for a bid.
+	 * @param deadline     the {@link Deadline} of the negotiation
 	 */
 	@JsonCreator
Index: /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/amop/AMOPState.java	(revision 24)
@@ -197,11 +197,8 @@
 
 	/**
-	 * @param actor         the actor that did this action. Can be used to check
-	 *                      if action is valid. NOTICE caller has to make sure
-	 *                      the current state is not final. MUST NOT be null.
-	 * @param action        the action that was proposed by actor. MUST NOT be
-	 *                      null.
-	 * @param currentTimeMs the current time in ms since 1970, see
-	 *                      {@link System#currentTimeMillis()}
+	 * @param actor  the actor that did this action. Can be used to check if
+	 *               action is valid. NOTICE caller has to make sure the current
+	 *               state is not final. MUST NOT be null.
+	 * @param action the action that was proposed by actor. MUST NOT be null.
 	 * @return new SessionState with the action added as last action.
 	 * @throws ProtocolException if actor is violating the protocol
Index: /protocol/src/main/java/geniusweb/protocol/session/amop/WillBeCalled.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/amop/WillBeCalled.java	(revision 24)
+++ /protocol/src/main/java/geniusweb/protocol/session/amop/WillBeCalled.java	(revision 24)
@@ -0,0 +1,46 @@
+package geniusweb.protocol.session.amop;
+
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Object containing function that will be called exactly once, on demand or at
+ * given deadline.
+ *
+ */
+public class WillBeCalled {
+	private static volatile ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(
+			2);
+	private final Runnable runnable;
+	private volatile AtomicBoolean done = new AtomicBoolean(false);
+
+	/**
+	 * @param r       the runnable that will be run once, either when the user
+	 *                calls {@link #complete()} or after delayMs, whichever
+	 *                comes first.
+	 * @param delayMs the delay after this will be called anywa (the 'deadline'
+	 *                in milliseconds. If null, no deadline call will be made
+	 *                and the user must call {@link #complete()} himself.
+	 */
+	public WillBeCalled(Runnable r, Long delayMs) {
+		this.runnable = r;
+		if (delayMs != null) {
+			executor.schedule(() -> complete(), delayMs, TimeUnit.MILLISECONDS);
+		}
+	}
+
+	/**
+	 * Tells the runnable to be executed. Only the first time the function is
+	 * run, subsequent calls do nothing. Failures in runnable are NOT caught
+	 * here, as they are probably bugs
+	 * 
+	 * We must avoid synchronized here because users may use synchronized blocks
+	 * already.
+	 */
+	public void complete() {
+		if (!done.compareAndSet(false, true))
+			return;
+		runnable.run();
+	}
+}
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java	(revision 24)
@@ -2,4 +2,5 @@
 
 import java.io.IOException;
+import java.util.Collections;
 import java.util.List;
 import java.util.Timer;
@@ -55,26 +56,25 @@
  * parties are freed up and another attempt is done to start all parties some
  * time later.
- * <li>the variable remainingparties = {all parties}
  * <li>The session deadline clock now starts ticking.
  * <li>remainingparties are sent their settings.
- * <li>Loop until {@link Deadline} is reached or |remainingparties|<2:
+ * <li>Loop until {@link Deadline} is reached or |remainingparties| &le; 2:
  * <ol>
  * <li>protocol sends {@link YourTurn} to all remainingparties. Each party now
  * must submit an {@link Offer} within {@link Phase#PHASE_MAXTIME} seconds. If a
  * party fails to submit it is removed from from remainingparties.
- * <li>protocol sends a {@link Voting} containing a List<Bid> containing all
- * received {@link Bid}s. Each party must place his {@link Votes} within
- * {@link #PHASE_TIME} seconds. If a party does not submit, it is terminated and
- * removed from remainingparties. Previous votes for the same bid do not count.
- * But see {@link Agreements}. A party that misbehaves after submitting its vote
- * is removed but it Votes remain standing.
+ * <li>protocol sends a {@link Voting} containing a List of Bid containing all
+ * received {@link Bid}s. Each party must place his {@link Votes} within the
+ * provided deadline. If a party does not submit, it is terminated and removed
+ * from remainingparties. Previous votes for the same bid do not count. But see
+ * {@link Agreements}. A party that misbehaves after submitting its vote is
+ * removed but it Votes remain standing.
  * <li>protocol sends to all remainingparties a OptIn containing all received
- * votes. Each party now must submit again a {@link Votes} object within
- * {@link #PHASE_TIME} seconds. This new Votes must equal or extend the previous
- * Votes of the party.
- * <li>The protocol use the {@link MOPACState#getEvaluator()} to determine the
- * ... . If there is such a subset, the parties that placed these votes reached
- * an agreement. They are added to the agreement set, sent the {@link Finished}
- * info and terminated. They are removed from the remainingparties.
+ * votes. Each party now must submit again a {@link Votes} object within the
+ * deadline. This new Votes must equal or extend the previous Votes of the
+ * party.
+ * <li>The protocol uses the {@link Phase#getEvaluator()} to determine the
+ * agreements from the votes. If there are agreements, the parties that placed
+ * these votes reached an agreement. They are moved to the agreement set and
+ * removed from the remainingparties.
  * </ol>
  * <li>Any remaining parties are sent a {@link Finished} object without
@@ -114,4 +114,10 @@
 	private final Reporter log;
 	private MOPACState state = null; // mutable!
+	/**
+	 * the existing party connections. we assume ownership of this so it should
+	 * not be modified although connections may of course break. mutable!
+	 */
+	private ProtocolToPartyConnections connections = new ProtocolToPartyConnections(
+			Collections.emptyList());
 
 	/**
@@ -124,5 +130,6 @@
 	/**
 	 * 
-	 * @param state normally the initial state coming from SAOPSettings
+	 * @param state  normally the initial state coming from SAOPSettings
+	 * @param logger the {@link Reporter} to use
 	 */
 	public MOPAC(MOPACState state, Reporter logger) {
@@ -145,15 +152,16 @@
 			ProtocolToPartyConnFactory connectionfactory) {
 		try {
-			// System.out.println("starting MOPAC");
-			// we're in Phase.INIT still
 			connect(connectionfactory);
-			setupParties();
-			long now = System.currentTimeMillis();
-			state = state.initPhase(now);
-			startPhase(now);
 		} catch (Throwable e) {
-			e.printStackTrace();
-			handleError("Failed to start MOPAC session", new PartyId("BUG"), e);
-		}
+			/** We can't {@link #handleError} yet. FIXME */
+			throw new RuntimeException("Failed to connect", e);
+		}
+		long now = System.currentTimeMillis();
+		state = state.initPhase(
+				ProgressFactory.create(state.getSettings().getDeadline(), now),
+				now);
+		setupParties(now);
+		startPhase(now);
+
 	}
 
@@ -212,9 +220,9 @@
 				.map(parti -> (parti.getParty().getPartyRef()))
 				.collect(Collectors.toList());
-		List<ProtocolToPartyConn> connections = null;
 		log.log(Level.INFO, "MOPAC connect " + parties);
-		while (connections == null) {
+		List<ProtocolToPartyConn> newconnections = null;
+		while (newconnections == null) {
 			try {
-				connections = connectionfactory.connect(parties);
+				newconnections = connectionfactory.connect(parties);
 			} catch (NoResourcesNowException e) {
 				long waitms = e.getLater().getTime()
@@ -228,5 +236,7 @@
 		}
 		for (int i = 0; i < participants.size(); i++) {
-			state = state.with(connections.get(i), participants.get(i));
+			ProtocolToPartyConn conn = newconnections.get(i);
+			connections = connections.with(conn);
+			state = state.with(conn.getParty(), participants.get(i));
 		}
 	}
@@ -239,15 +249,11 @@
 	 * part of the interface.
 	 * 
-	 * @throws ProtocolException if a party does not follow the protocol
-	 */
-	protected synchronized void setupParties() throws ProtocolException {
-		for (ProtocolToPartyConn conn : state.getConnections()) {
-			conn.addListener(action -> actionRequest(conn, action,
-					System.currentTimeMillis()));
-		}
-		Long now = System.currentTimeMillis();
-		state = state.with(
-				ProgressFactory.create(state.getSettings().getDeadline(), now));
-		for (ProtocolToPartyConn connection : state.getConnections()) {
+	 * @param now the current time.
+	 */
+	protected synchronized void setupParties(long now) {
+		for (ProtocolToPartyConn conn : connections) {
+			conn.addListener(action -> actionRequest(conn, action, now));
+		}
+		for (ProtocolToPartyConn connection : connections) {
 			try {
 				sendSettings(connection);
@@ -257,5 +263,4 @@
 			}
 		}
-
 	}
 
@@ -357,49 +362,11 @@
 				.getNegotiatingParties()) {
 			try {
-				state.getConnections().get(party).send(info);
+				connections.get(party).send(info);
 			} catch (IOException e) {
-				handleError("Party seems to have disconnected", party, e);
-			}
-		}
-	}
-
-	/**
-	 * Update state to include the given error and closes the party.
-	 * 
-	 * @param message The message to attach to the error
-	 * @param party   the party where the error occured
-	 * @param e       the exception that occured.
-	 */
-	private void handleError(final String message, final PartyId partyid,
-			final Throwable e) {
-		if (e instanceof ProtocolException) {
-			state = state.with((ProtocolException) e);
-		} else {
-			state = state.with(new ProtocolException(message, partyid, e));
-		}
-		log.log(Level.WARNING,
-				"MOPAC intercepted error from party " + partyid + ":" + message,
-				e);
-	}
-
-//	/**
-//	 * Sets the new state. If the new state is final, the finish-up procedure is
-//	 * executed. All state changes go through here to ensure we check isFinal
-//	 * before any state change.
-//	 * 
-//	 * @param newstate the new state.
-//	 */
-//	private synchronized void setState(MOPACState newstate) {
-//		long now = System.currentTimeMillis();
-//		if (state.isFinal(now)) {
-//			endNegotiation();
-//			return;
-//		}
-//
-//		this.state = newstate;
-//		if (newstate.isFinal(now)) {
-//			endNegotiation();
-//		}
-//	}
+				state = state.with(new ProtocolException(
+						"Party seems to have disconnected", party, e));
+			}
+		}
+	}
 
 	/**
@@ -413,5 +380,5 @@
 		finished = true;
 		Finished info = new Finished(state.getAgreements());
-		for (ProtocolToPartyConn conn : state.getConnections()) {
+		for (ProtocolToPartyConn conn : connections) {
 			try {
 				conn.send(info);
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACSettings.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACSettings.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACSettings.java	(revision 24)
@@ -19,5 +19,5 @@
 /**
  * Settings for MOPAC negotiation. in MOPAC, each party may get a "power"
- * parameter containing an natural number >=1.
+ * parameter containing an natural number &le;1.
  */
 public class MOPACSettings implements SessionSettings {
@@ -30,11 +30,9 @@
 	 * @param participants the list of {@link PartyWithProfile} in clockwise
 	 *                     order. There must be at least 2 to run the MOPAC
-	 *                     protocol. But SAOP can be initialized with less, for
-	 *                     use in TournamentSettings.
-	 * 
-	 *                     All provided participants must
-	 * 
-	 * @param deadline
-	 * @param minimumVotes the minimum number of votes allowed for a bid.
+	 *                     protocol. This is not tested in the constructor
+	 *                     because this can be initialized with less, for use in
+	 *                     TournamentSettings.
+	 * @param deadline     the {@link Deadline} for the negotiation
+	 * @param votingeval   the {@link VotingEvaluator} to use.
 	 */
 	@JsonCreator
@@ -90,5 +88,5 @@
 
 	@Override
-	public SessionSettings with(TeamOfPartiesAndProfiles party) {
+	public MOPACSettings with(TeamOfPartiesAndProfiles party) {
 		if (!(party instanceof OnePartyTeam))
 			throw new IllegalArgumentException(
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java	(revision 24)
@@ -17,7 +17,6 @@
 import geniusweb.progress.Progress;
 import geniusweb.progress.ProgressRounds;
+import geniusweb.protocol.NegoProtocol;
 import geniusweb.protocol.ProtocolException;
-import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
-import geniusweb.protocol.partyconnection.ProtocolToPartyConnections;
 import geniusweb.protocol.session.SessionResult;
 import geniusweb.protocol.session.SessionState;
@@ -27,12 +26,25 @@
 import geniusweb.protocol.session.saop.SAOPSettings;
 import geniusweb.references.PartyWithProfile;
-import geniusweb.voting.VotingEvaluator;
-
+
+/**
+ * Keeps track of the current {@link Phase}. Adds initializing stuff and
+ * time/deadline checking. This state does not contain connections, this assumes
+ * that someone else handles (i.e. {@link NegoProtocol} that and the connections
+ * with the parties and that negotiation events are just pumped in from there.
+ * <p>
+ * This object is a bit tricky. It has two states
+ * <ol>
+ * <li>The initial state, where phase=null and connections are being made to all
+ * parties. At this point, problems can not be handled nicely yet because there
+ * are no PartyId's for problematic parties
+ * <li>The working state, where all parties are connected and all problems can
+ * be connected to an offending party.
+ * </ol>
+ */
 public class MOPACState implements SessionState {
 
-	private final Phase phase;
+	private final Phase phase; // maybe null while initializing
 	private final MOPACSettings settings;
 	private final Map<PartyId, PartyWithProfile> partyprofiles;
-	private final ProtocolToPartyConnections connections;
 	private final List<Action> actions;
 	private final Progress progress;
@@ -44,7 +56,5 @@
 	 */
 	public MOPACState(MOPACSettings settings) {
-		this(null, Arrays.asList(),
-				new ProtocolToPartyConnections(Collections.emptyList()), null,
-				settings, Collections.emptyMap());
+		this(null, Arrays.asList(), null, settings, Collections.emptyMap());
 
 	}
@@ -54,28 +64,26 @@
 	 *                      set something only after we have connections.
 	 * @param actions       the legal actions that have been done in the
-	 *                      negotiation. A new-sub-list is added for each phase
-	 *                      change. It is assumed that the last element of the
-	 *                      list is the list with actions taken in the current
-	 *                      phase. first action in first list is the oldest.
-	 *                      This MUST NOT contain illegal actions. Parties doing
-	 *                      illegal actions are killed and the offending action
-	 *                      ends up in the stacktrace. Previous actions of
-	 *                      crashed parties remain standing and valid.
-	 * @param conns         the existing party connections. we assume ownership
-	 *                      of this so it should not be modified although
-	 *                      connections may of course break.
+	 *                      negotiation. {@link PartyStates#getActions()} is
+	 *                      called to collect the actions after the phase is
+	 *                      finished.first action in list is the oldest. This
+	 *                      will not contain actions that immediately led to an
+	 *                      agreement, because {@link PartyStates} removes the
+	 *                      actions that led to an agreement. This MUST NOT
+	 *                      contain illegal actions. Parties doing illegal
+	 *                      actions are killed and the offending action ends up
+	 *                      in the stacktrace. Previous actions of crashed
+	 *                      parties remain standing and valid.
 	 * @param progress      the {@link Progress} line. can be null if not yet
-	 *                      known. This happens because during setup we first
-	 *                      add all connections, and only when we have that we
-	 *                      set the correct deadline.
+	 *                      known. null happens because during initialization
+	 *                      phase the protocol first add all connections. During
+	 *                      this time, parties may already enter the
+	 *                      failed/exception state.
 	 * @param settings      the {@link SAOPSettings}
 	 * @param partyprofiles map with the {@link PartyWithProfile} for connected
 	 *                      parties. null is equivalent to an empty map.
-	 * @param evaluator     the {@link VotingEvaluator}
 	 */
 	@JsonCreator
 	protected MOPACState(@JsonProperty("phase") Phase phase,
 			@JsonProperty("actions") List<Action> actions,
-			@JsonProperty("connections") ProtocolToPartyConnections conns,
 			@JsonProperty("progress") Progress progress,
 			@JsonProperty("settings") MOPACSettings settings,
@@ -83,5 +91,4 @@
 		this.phase = phase;
 		this.actions = actions;
-		this.connections = conns;
 		this.progress = progress;
 		this.settings = settings;
@@ -90,101 +97,101 @@
 
 	/**
-	 * Can be called after all connections are initialized.
-	 * 
-	 * @param now current time ms since 1970
-	 * 
-	 * @return state with the initial partystates set.
-	 */
-	public MOPACState initPhase(long now) {
-		PartyStates partyStates = new PartyStates(getPowers());
-		Phase firstPhase = new OfferPhase(null, partyStates,
-				now + getAvailablePhaseTime(now),
-				settings.getVotingEvaluation());
-		return new MOPACState(firstPhase, actions, connections, progress,
-				settings, partyprofiles);
-	}
-
-	@Override
-	public List<Action> getActions() {
-		return Collections.unmodifiableList(actions);
-	}
-
-	@Override
-	public Progress getProgress() {
-		return progress;
-	}
-
-	public Map<PartyId, PartyWithProfile> getPartyProfiles() {
-		return Collections.unmodifiableMap(partyprofiles);
-	}
-
-	/**
-	 * @return all current/remaining active party connections. Finished/crashed
-	 *         parties should be removed immediately.
-	 */
-	public ProtocolToPartyConnections getConnections() {
-		return connections;
-	}
-
-	/**
-	 * @param now current time ms since 1970
-	 * @return the max possible duration in ms of the NEXT phase. Maybe 0 or
-	 *         negative if past deadline.
-	 */
-	private Long getAvailablePhaseTime(long now) {
-		// explicit check, to check also the round counts.
-		if (incrementProgress().isPastDeadline(now + Phase.PHASE_MINTIME))
-			return 0l;
-		return Math.min(progress.getTerminationTime().getTime() - now,
-				Phase.PHASE_MAXTIME);
-	}
-
-	/**
-	 * 
-	 * @param connection   the new {@link ProtocolToPartyConn}
-	 * @param partyprofile the {@link PartyWithProfile} that is associated with
-	 *                     this state
-	 * @return new {@link MOPACState} with the new connection added. This call
-	 *         ignores the progress (does not check isFinal) because we uses
-	 *         this during the setup where the deadline is not yet relevant.
-	 */
-	protected MOPACState with(ProtocolToPartyConn connection,
-			PartyWithProfile partyprofile) {
-		if (phase != null)
-			throw new IllegalStateException(
-					"Adding connections only allowed while initializing");
-
-		ProtocolToPartyConnections newconns = getConnections().with(connection);
-		Map<PartyId, PartyWithProfile> newprofiles = new HashMap<>(
-				partyprofiles);
-		newprofiles.put(connection.getParty(), partyprofile);
-		return new MOPACState(null, actions, newconns, progress, settings,
-				newprofiles);
-	}
-
-	/**
-	 * @param id the {@link PartyId} of the party that failed.
-	 * @param e  the {@link ProtocolException} that occurred in the party
-	 * @return a new state with the error set.
-	 */
-	public MOPACState with(ProtocolException e) {
-		return new MOPACState(phase.with(e), actions, connections, progress,
-				settings, partyprofiles);
-	}
-
-	/**
-	 * Sets the progress for this session. Can be set only if progress=null.
-	 * Should be set in INIT phase.
-	 * 
-	 * @param newprogress the new progress
-	 * @return new {@link MOPACState} with the progress set
-	 */
-	public MOPACState with(Progress newprogress) {
+	 * Sets the progress for this session and initial phase. Must be called
+	 * after all parties have been connected with
+	 * {@link #with(PartyId, PartyWithProfile)}.
+	 * 
+	 * @param newprogress the initial {@link Progress} typically matching the
+	 *                    settings deadline object
+	 * @param now         current time ms since 1970
+	 * 
+	 * @return state with the initial partystates , progress set.
+	 */
+	public MOPACState initPhase(Progress newprogress, long now) {
 		if (progress != null || newprogress == null || phase != null) {
 			throw new IllegalArgumentException(
 					"progress must be null, newprogress must be not null and phase must be INIT");
 		}
-		return new MOPACState(phase, actions, connections, newprogress,
-				getSettings(), partyprofiles);
+
+		PartyStates partyStates = new PartyStates(getPowers());
+		Phase firstPhase = new OfferPhase(partyStates,
+				now + getAvailablePhaseTime(newprogress, now),
+				settings.getVotingEvaluation());
+		return new MOPACState(firstPhase, actions, newprogress, settings,
+				partyprofiles);
+	}
+
+	@Override
+	public List<Action> getActions() {
+		return Collections.unmodifiableList(actions);
+	}
+
+	@Override
+	public Progress getProgress() {
+		return progress;
+	}
+
+	@Override
+	public Agreements getAgreements() {
+		return phase.getPartyStates().getAgreements();
+	}
+
+	@Override
+	public MOPACSettings getSettings() {
+		return settings;
+	}
+
+	public Map<PartyId, PartyWithProfile> getPartyProfiles() {
+		return Collections.unmodifiableMap(partyprofiles);
+	}
+
+	@Override
+	public boolean isFinal(long now) {
+		return phase != null && phase.isFinal(now) && !isNewPhasePossible(now);
+	}
+
+	@Override
+	public SessionResult getResult() {
+		return new SessionResult(partyprofiles, getAgreements(),
+				Collections.emptyMap(), null);
+	}
+
+	/**
+	 * @param progress the Progress that needs to be checked
+	 * @param now      current time ms since 1970
+	 * @return the max possible duration in ms of a phase considering the
+	 *         progress.
+	 */
+	private static Long getAvailablePhaseTime(Progress aprogress, long now) {
+		return Math.min(aprogress.getTerminationTime().getTime() - now,
+				Phase.PHASE_MAXTIME);
+	}
+
+	/**
+	 * @param id           the new {@link PartyId}
+	 * @param partyprofile the {@link PartyWithProfile} that is associated with
+	 *                     this state
+	 * @return new {@link MOPACState} with the new party added. This call
+	 *         ignores the progress (does not check isFinal) because we uses
+	 *         this during the setup where the deadline is not yet relevant.
+	 */
+	protected MOPACState with(PartyId id, PartyWithProfile partyprofile) {
+		if (phase != null)
+			throw new IllegalStateException(
+					"Adding connections only allowed while initializing");
+
+		Map<PartyId, PartyWithProfile> newprofiles = new HashMap<>(
+				partyprofiles);
+		newprofiles.put(id, partyprofile);
+		return new MOPACState(null, actions, progress, settings, newprofiles);
+	}
+
+	/**
+	 * @param e the {@link ProtocolException} that occured
+	 * @return a new state with the error set. You MUST have called
+	 *         {@link #initPhase(Progress, long)} before using this
+	 */
+	public MOPACState with(ProtocolException e) {
+		return new MOPACState(phase.with(e), actions, progress, settings,
+				partyprofiles);
 	}
 
@@ -202,22 +209,6 @@
 				Math.min(remainingNegoTime, Phase.PHASE_MAXTIME));
 
-		return new MOPACState(newphase, actions, connections,
-				incrementProgress(), getSettings(), partyprofiles);
-	}
-
-	/**
-	 * 
-	 * @return the next progress. Progress round advances if phase is
-	 *         {@link OptIn}.
-	 */
-	private Progress incrementProgress() {
-		if (progress instanceof ProgressRounds && phase instanceof OptInPhase)
-			return ((ProgressRounds) progress).advance();
-		return progress;
-	}
-
-	@Override
-	public boolean isFinal(long now) {
-		return phase != null && phase.isFinal(now) && !isNewPhasePossible(now);
+		return new MOPACState(newphase, actions, increment(progress, phase),
+				getSettings(), partyprofiles);
 	}
 
@@ -225,23 +216,17 @@
 	 * When this is called, all parties should have acted.
 	 * 
-	 * @param now
-	 * @return
+	 * @param now current time
+	 * @return true if there are still &gt;2 parties active and we have enough
+	 *         time for a new phase.
 	 */
 	public boolean isNewPhasePossible(long now) {
 		// System.out.println("phase=" + phase);
-		boolean a = phase.getPartyStates().getNegotiatingParties().size() >= 2
-				&& getAvailablePhaseTime(now) > Phase.PHASE_MINTIME;
-		// System.out.println("newstate possible:" + a);
-		return a;
-	}
-
-	@Override
-	public Agreements getAgreements() {
-		return phase.getPartyStates().getAgreements();
-	}
-
-	@Override
-	public MOPACSettings getSettings() {
-		return settings;
+		Progress newprogress = increment(progress, phase);
+		if (newprogress.isPastDeadline(now + Phase.PHASE_MINTIME))
+			return false;
+
+		return phase.getPartyStates().getNegotiatingParties().size() >= 2
+				&& getAvailablePhaseTime(newprogress,
+						now) > Phase.PHASE_MINTIME;
 	}
 
@@ -261,15 +246,24 @@
 	 * @param now    the current time in ms since 1970, see
 	 *               {@link System#currentTimeMillis()}
+	 * @return new {@link MOPACState} with the action checked and registered. If
+	 *         the action is not allowed, the new state may be that the actor is
+	 *         in the exception list.
 	 */
 
 	public MOPACState with(PartyId actor, Action action, long now) {
-		return new MOPACState(phase.with(actor, action, now), actions,
-				connections, progress, settings, partyprofiles);
-	}
-
-	@Override
-	public SessionResult getResult() {
-		return new SessionResult(partyprofiles, getAgreements(),
-				Collections.emptyMap(), null);
+		return new MOPACState(phase.with(actor, action, now), actions, progress,
+				settings, partyprofiles);
+	}
+
+	/**
+	 * @param aprogress the progress that might need to be advanced
+	 * @param aphase    the phase
+	 * @return the next progress. Progress round advances if phase is
+	 *         {@link OptIn}.
+	 */
+	private static Progress increment(Progress aprogress, Phase aphase) {
+		if (aprogress instanceof ProgressRounds && aphase instanceof OptInPhase)
+			return ((ProgressRounds) aprogress).advance();
+		return aprogress;
 	}
 
@@ -294,5 +288,5 @@
 	public String toString() {
 		return "MOPACState[" + phase + "," + settings + "," + partyprofiles
-				+ "," + connections + "," + progress + "," + "]";
+				+ "," + progress + "]";
 	}
 
@@ -306,6 +300,58 @@
 		LinkedList<Action> newactions = new LinkedList<Action>(actions);
 		newactions.addAll(newphase.getPartyStates().getActions());
-		return new MOPACState(newphase, newactions, connections, progress,
-				settings, partyprofiles);
+		return new MOPACState(newphase, newactions, progress, settings,
+				partyprofiles);
+	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((actions == null) ? 0 : actions.hashCode());
+		result = prime * result
+				+ ((partyprofiles == null) ? 0 : partyprofiles.hashCode());
+		result = prime * result + ((phase == null) ? 0 : phase.hashCode());
+		result = prime * result
+				+ ((progress == null) ? 0 : progress.hashCode());
+		result = prime * result
+				+ ((settings == null) ? 0 : settings.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;
+		MOPACState other = (MOPACState) obj;
+		if (actions == null) {
+			if (other.actions != null)
+				return false;
+		} else if (!actions.equals(other.actions))
+			return false;
+		if (partyprofiles == null) {
+			if (other.partyprofiles != null)
+				return false;
+		} else if (!partyprofiles.equals(other.partyprofiles))
+			return false;
+		if (phase == null) {
+			if (other.phase != null)
+				return false;
+		} else if (!phase.equals(other.phase))
+			return false;
+		if (progress == null) {
+			if (other.progress != null)
+				return false;
+		} else if (!progress.equals(other.progress))
+			return false;
+		if (settings == null) {
+			if (other.settings != null)
+				return false;
+		} else if (!settings.equals(other.settings))
+			return false;
+		return true;
 	}
 
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/PartyStates.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/PartyStates.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/PartyStates.java	(revision 24)
@@ -1,6 +1,4 @@
 package geniusweb.protocol.session.mopac;
 
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -12,4 +10,9 @@
 import java.util.stream.Collectors;
 
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
 import geniusweb.actions.Action;
 import geniusweb.actions.EndNegotiation;
@@ -19,6 +22,6 @@
 
 /**
- * The current state of all participating parties. A party either notYetActed,
- * did action, reached an agreement, walked away or made a
+ * Invariant: contains the current state of all participating parties. A party
+ * either notYetActed, did action, reached an agreement, walked away or made a
  * {@link ProtocolException}.
  * <p>
@@ -26,6 +29,6 @@
  * agreements and move remaining parties back to notYetActed.
  * 
- * This is not considering current time or checking actions.
  */
+@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
 public class PartyStates {
 	// all parties must be in exactly one state at all times.
@@ -35,5 +38,20 @@
 	private final List<PartyId> walkedAway;
 	private final Map<PartyId, ProtocolException> exceptions;
-	private Map<PartyId, Integer> powers;
+	private final Map<PartyId, Integer> powers;
+
+	@JsonCreator
+	protected PartyStates(@JsonProperty("notYetActed") Set<PartyId> notYetActed,
+			@JsonProperty("actions") List<Action> actions,
+			@JsonProperty("agreements") Agreements agreements,
+			@JsonProperty("walkedAway") List<PartyId> walkedAway,
+			@JsonProperty("exceptions") Map<PartyId, ProtocolException> exceptions,
+			@JsonProperty("powers") Map<PartyId, Integer> powers) {
+		this.notYetActed = notYetActed;
+		this.actions = actions;
+		this.agreements = agreements;
+		this.walkedAway = walkedAway;
+		this.exceptions = exceptions;
+		this.powers = powers;
+	}
 
 	/**
@@ -51,20 +69,12 @@
 	}
 
-	public PartyStates(Set<PartyId> notYetActed, List<Action> actions,
-			Agreements agreements, List<PartyId> walkedAway,
-			Map<PartyId, ProtocolException> exceptions,
-			Map<PartyId, Integer> powers) {
-		this.notYetActed = notYetActed;
-		this.actions = actions;
-		this.agreements = agreements;
-		this.walkedAway = walkedAway;
-		this.exceptions = exceptions;
-		this.powers = powers;
-	}
-
-	/**
-	 * 
-	 * @param action
-	 * @return new state with party done given action.
+	/**
+	 * 
+	 * @param action the action done by some party. The correctness of action,
+	 *               particularly of {@link Action#getActor()}, must be correct.
+	 * @return new state with party done given action. This just accepts any
+	 *         given action and is not considering number of rounds, time or
+	 *         whether an action is allowed.
+	 * 
 	 * @throws IllegalArgumentException if party doing action already acted.
 	 *                                  This is just a safety check as legality
@@ -151,10 +161,16 @@
 
 	/**
-	 * 
 	 * @param actor
 	 * @return {@link #notYetActed} with actor removed
-	 */
-	private Set<PartyId> removeParty(PartyId actor) {
-		return removeParties(new HashSet<>(Arrays.asList(actor)));
+	 * @throws IllegalArgumentException if party already acted (not in
+	 *                                  {@link #notYetActed}).
+	 */
+	private Set<PartyId> removeParty(PartyId party) {
+		Set<PartyId> newActiveParties = new HashSet<>(notYetActed);
+		if (!newActiveParties.remove(party))
+			throw new IllegalArgumentException(
+					"Party " + party + " is not active, can't be removed");
+		return newActiveParties;
+
 	}
 
@@ -169,19 +185,4 @@
 	public Map<PartyId, ProtocolException> getExceptions() {
 		return Collections.unmodifiableMap(exceptions);
-	}
-
-	/**
-	 * 
-	 * @param parties the parties to remove
-	 * @return {@link #notYetActed} without the given parties.
-	 */
-	private Set<PartyId> removeParties(Collection<PartyId> parties) {
-		Set<PartyId> newActiveParties = new HashSet<>(notYetActed);
-		for (PartyId party : parties) {
-			if (!newActiveParties.remove(party))
-				throw new IllegalArgumentException(
-						"Party " + party + " is not active, can't be removed");
-		}
-		return newActiveParties;
 	}
 
@@ -204,5 +205,16 @@
 
 	/**
-	 * @param type the type of actions to extract
+	 * 
+	 * @return all parties that walked away
+	 */
+	public List<PartyId> getWalkedAway() {
+		return walkedAway;
+	}
+
+	/**
+	 * @param <T>  the type of objects requested
+	 * @param type the type of actions to extract. Must be of type T, needed
+	 *             because of java's type erasure.
+	 * 
 	 * @return all actions of type done in this phase
 	 */
@@ -233,3 +245,62 @@
 	}
 
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result + ((actions == null) ? 0 : actions.hashCode());
+		result = prime * result
+				+ ((agreements == null) ? 0 : agreements.hashCode());
+		result = prime * result
+				+ ((exceptions == null) ? 0 : exceptions.hashCode());
+		result = prime * result
+				+ ((notYetActed == null) ? 0 : notYetActed.hashCode());
+		result = prime * result + ((powers == null) ? 0 : powers.hashCode());
+		result = prime * result
+				+ ((walkedAway == null) ? 0 : walkedAway.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;
+		PartyStates other = (PartyStates) obj;
+		if (actions == null) {
+			if (other.actions != null)
+				return false;
+		} else if (!actions.equals(other.actions))
+			return false;
+		if (agreements == null) {
+			if (other.agreements != null)
+				return false;
+		} else if (!agreements.equals(other.agreements))
+			return false;
+		if (exceptions == null) {
+			if (other.exceptions != null)
+				return false;
+		} else if (!exceptions.equals(other.exceptions))
+			return false;
+		if (notYetActed == null) {
+			if (other.notYetActed != null)
+				return false;
+		} else if (!notYetActed.equals(other.notYetActed))
+			return false;
+		if (powers == null) {
+			if (other.powers != null)
+				return false;
+		} else if (!powers.equals(other.powers))
+			return false;
+		if (walkedAway == null) {
+			if (other.walkedAway != null)
+				return false;
+		} else if (!walkedAway.equals(other.walkedAway))
+			return false;
+		return true;
+	}
+
 }
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/DefaultPhase.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/DefaultPhase.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/DefaultPhase.java	(revision 24)
@@ -1,12 +1,6 @@
 package geniusweb.protocol.session.mopac.phase;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
 
 import geniusweb.actions.Action;
 import geniusweb.actions.PartyId;
-import geniusweb.actions.Votes;
 import geniusweb.protocol.ProtocolException;
 import geniusweb.protocol.session.mopac.PartyStates;
@@ -17,26 +11,15 @@
 	protected final Long deadline;
 	protected final PartyStates partyStates;
-
-	// don't serialize this, users don't need it..
-	@JsonIgnore
 	protected final VotingEvaluator evaluator;
 
-	// don't serialize this, it will cause very large file
-	@JsonIgnore
-	protected final Phase prevPhase;
-
 	/**
-	 * 
-	 * @param actions     the actions done in this phase .
-	 * @param prevPhase   the previous phase, can be used to collect previous
-	 *                    votes etc.
-	 * @param partyStates
+	 * @param partyStates the {@link PartyStates}
 	 * @param deadline    deadline for this phase, ms since 1970
+	 * @param evaluator   the {@link VotingEvaluator} to be used
 	 */
-	public DefaultPhase(Phase prevPhase, PartyStates partyStates, Long deadline,
+	public DefaultPhase(PartyStates partyStates, Long deadline,
 			VotingEvaluator evaluator) {
 		this.partyStates = partyStates;
 		this.deadline = deadline;
-		this.prevPhase = prevPhase;
 		this.evaluator = evaluator;
 	}
@@ -53,13 +36,4 @@
 
 	/**
-	 * @return all votes done in this phase.
-	 */
-	public List<Votes> getVotes() {
-		return partyStates.getActions().stream()
-				.filter(act -> act instanceof Votes).map(act -> (Votes) act)
-				.collect(Collectors.toList());
-	}
-
-	/**
 	 * Check if actor can do given action. Basic checks:
 	 * <ul>
@@ -70,13 +44,10 @@
 	 * </ul>
 	 * 
-	 * @param activeParties the currently active parties
-	 * @param actor
-	 * @param action
-	 * @param timems
-	 * @throws ProtocolException
-	 * @throw ProtocolException if the action violates the protocol, or null if
-	 *        ok
+	 * @param actor  the actor that really acted
+	 * @param action the action that was done
+	 * @param now    current time
+	 * @throws ProtocolException if the action violates the protocol
 	 */
-	protected void checkAction(PartyId actor, Action action, long timems)
+	protected void checkAction(PartyId actor, Action action, long now)
 			throws ProtocolException {
 		if (action == null)
@@ -86,10 +57,9 @@
 					"Incorrect actor info in action:" + action.getActor(),
 					actor);
-		if (isFinal(timems))
+		if (isFinal(now))
 			throw new ProtocolException("passed deadline", actor);
 		if (!(getAllowedActions().contains(action.getClass())))
-			throw new ProtocolException(
-					"Action not allowed in " + this.getClass() + ":" + action,
-					actor);
+			throw new ProtocolException("Action not allowed in "
+					+ this.getClass().getSimpleName() + ": " + action, actor);
 		if (!partyStates.getNotYetActed().contains(actor))
 			throw new ProtocolException("Actor can not act anymore", actor);
@@ -98,5 +68,4 @@
 
 	/**
-	 * @param timems current time
 	 * @return current PartyStates
 	 */
@@ -116,24 +85,61 @@
 			throw new IllegalArgumentException("Bug, illegal duration");
 		if (!isFinal(now))
-			throw new IllegalStateException(
-					"next must only be called when phase isFinal");
-		if (!partyStates.getNotYetActed().isEmpty())
-			throw new IllegalStateException("Bug. State has not been finished");
+			throw new IllegalStateException("phase is not final");
 		return checkedNext(now + duration);
 	}
 
 	/**
+	 * As {@link #next(long, long)} but DefaultPhase already checked that 1.
+	 * there is enough time for a next phase 2. current state is final 3.
 	 * 
-	 * @param deadline
+	 * @param dl the deadline for the next phase (ms since 1970).
 	 * @return the next phase
 	 */
-	protected abstract Phase checkedNext(long deadline);
+	protected abstract Phase checkedNext(long dl);
 
 	@Override
 	public String toString() {
-		// don't print prev state, it will give HUGE list because it also
-		// contains prevstate.....
 		return getClass().getSimpleName() + "[" + partyStates + "," + deadline
 				+ "," + evaluator + "]";
 	}
+
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result
+				+ ((deadline == null) ? 0 : deadline.hashCode());
+		result = prime * result
+				+ ((evaluator == null) ? 0 : evaluator.hashCode());
+		result = prime * result
+				+ ((partyStates == null) ? 0 : partyStates.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;
+		DefaultPhase other = (DefaultPhase) obj;
+		if (deadline == null) {
+			if (other.deadline != null)
+				return false;
+		} else if (!deadline.equals(other.deadline))
+			return false;
+		if (evaluator == null) {
+			if (other.evaluator != null)
+				return false;
+		} else if (!evaluator.equals(other.evaluator))
+			return false;
+		if (partyStates == null) {
+			if (other.partyStates != null)
+				return false;
+		} else if (!partyStates.equals(other.partyStates))
+			return false;
+		return true;
+	}
 }
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OfferPhase.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OfferPhase.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OfferPhase.java	(revision 24)
@@ -4,4 +4,7 @@
 import java.util.List;
 import java.util.stream.Collectors;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 import geniusweb.actions.Action;
@@ -18,7 +21,9 @@
 public class OfferPhase extends DefaultPhase {
 
-	public OfferPhase(Phase prevPhase, PartyStates partyStates, Long deadlinems,
-			VotingEvaluator evaluator) {
-		super(prevPhase, partyStates, deadlinems, evaluator);
+	@JsonCreator
+	public OfferPhase(@JsonProperty("partyStates") PartyStates partyStates,
+			@JsonProperty("deadlinems") Long deadlinems,
+			@JsonProperty("evaluator") VotingEvaluator evaluator) {
+		super(partyStates, deadlinems, evaluator);
 	}
 
@@ -30,6 +35,5 @@
 			return this.with(ex);
 		}
-		return new OfferPhase(prevPhase, partyStates.with(action), deadline,
-				evaluator);
+		return new OfferPhase(partyStates.with(action), deadline, evaluator);
 	}
 
@@ -42,20 +46,19 @@
 	public OfferPhase with(ProtocolException e) {
 		System.out.println("Party kicked because of protocol exception:" + e);
-		return new OfferPhase(prevPhase, partyStates.with(e), deadline,
-				evaluator);
+		return new OfferPhase(partyStates.with(e), deadline, evaluator);
 	}
 
 	@Override
 	public Phase finish() {
-		return new OfferPhase(prevPhase, partyStates.finish(), deadline,
-				evaluator);
+		return new OfferPhase(partyStates.finish(), deadline, evaluator);
 	}
 
 	@Override
 	public VotingPhase checkedNext(long deadln) {
-		return new VotingPhase(this, partyStates.flush(), deadln, evaluator);
+		return new VotingPhase(getOffers(), partyStates.flush(), deadln,
+				evaluator);
 	}
 
-	public List<Bid> getOffers() {
+	protected List<Bid> getOffers() {
 		return partyStates.getActions(Offer.class).stream()
 				.map(offer -> offer.getBid()).collect(Collectors.toList());
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OptInPhase.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OptInPhase.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/OptInPhase.java	(revision 24)
@@ -5,4 +5,7 @@
 import java.util.Map;
 import java.util.stream.Collectors;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 import geniusweb.actions.Action;
@@ -20,12 +23,21 @@
 public class OptInPhase extends DefaultPhase {
 
-	protected OptInPhase(Phase prevPhase, PartyStates partyStates,
-			Long deadlinems, VotingEvaluator evaluator) {
-		super(prevPhase, partyStates, deadlinems, evaluator);
+	/**
+	 * The votes received in the {@link VotingPhase}
+	 */
+	private final List<Votes> votes;
+
+	@JsonCreator
+	protected OptInPhase(@JsonProperty("votes") List<Votes> votes,
+			@JsonProperty("partyStates") PartyStates partyStates,
+			@JsonProperty("deadlinems") Long deadlinems,
+			@JsonProperty("evaluator") VotingEvaluator evaluator) {
+		super(partyStates, deadlinems, evaluator);
+		this.votes = votes;
 	}
 
 	@Override
 	public Inform getInform() {
-		return new OptIn(((VotingPhase) prevPhase).getVotes());
+		return new OptIn(votes);
 	}
 
@@ -35,7 +47,7 @@
 			checkAction(actor, action, now);
 			if (action instanceof Votes)
-				checkExtends(action);
+				checkExtends((Votes) action);
 
-			return new OptInPhase(prevPhase, partyStates.with(action), deadline,
+			return new OptInPhase(votes, partyStates.with(action), deadline,
 					evaluator);
 
@@ -48,18 +60,15 @@
 	 * Check that this action extends previous action.
 	 * 
-	 * @param action
-	 * @param phase
+	 * @param newvotes new {@link Votes} just received
 	 * @throws ProtocolException if this action does not correctly extend
 	 *                           previous vote.
 	 */
-	private void checkExtends(Action action) throws ProtocolException {
-
-		Votes votes = (Votes) action;
-		PartyId actor = action.getActor();
+	private void checkExtends(Votes newvotes) throws ProtocolException {
+		PartyId actor = newvotes.getActor();
 		// this actor is active so he must have voted in previous round.
-		Votes prevVotes = ((VotingPhase) prevPhase).getVotes().stream()
-				.filter(v -> v.getActor().equals(actor)).findFirst().get();
-		if (!(votes.isExtending(prevVotes)))
-			throw new ProtocolException("New votes " + action
+		Votes prevVotes = votes.stream().filter(v -> v.getActor().equals(actor))
+				.findFirst().get();
+		if (!(newvotes.isExtending(prevVotes)))
+			throw new ProtocolException("New votes " + newvotes
 					+ " does not extend previous vote " + prevVotes, actor);
 	}
@@ -67,6 +76,5 @@
 	@Override
 	public OptInPhase with(ProtocolException e) {
-		return new OptInPhase(prevPhase, partyStates.with(e), deadline,
-				evaluator);
+		return new OptInPhase(votes, partyStates.with(e), deadline, evaluator);
 	}
 
@@ -84,11 +92,10 @@
 		PartyStates finalStates = states.with(newAgree);
 
-		return new OptInPhase(prevPhase, finalStates, deadline, evaluator);
+		return new OptInPhase(votes, finalStates, deadline, evaluator);
 	}
 
 	@Override
 	public OfferPhase checkedNext(long newdeadline) {
-		return new OfferPhase(this, partyStates.flush(), newdeadline,
-				evaluator);
+		return new OfferPhase(partyStates.flush(), newdeadline, evaluator);
 	}
 
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/Phase.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/Phase.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/Phase.java	(revision 24)
@@ -2,8 +2,9 @@
 
 import java.util.List;
-import java.util.Set;
 
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
 
 import geniusweb.actions.Action;
@@ -17,7 +18,20 @@
  * A Phase is a part of the round structure. In each round parties have to take
  * multiple actions. Each action is part of a phase.
- *
+ * 
+ * Invariant: A phase object handles negotiation events, ensuring that the
+ * events are handled according to the possible actions in this phase. A phase
+ * object must always remain in a consistent state. It does so by modifying the
+ * contained {@link PartyStates} as needed.
+ * <p>
+ * The standard exception handling is assumed: unchecked exceptions are thrown
+ * only if there is a bug in the protocol. Because none of the functions in this
+ * interface throws, any error must be either ignored or the party must be
+ * kicked.
  */
-@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
+@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
+@JsonSubTypes({ @JsonSubTypes.Type(value = OfferPhase.class),
+		@JsonSubTypes.Type(value = OptInPhase.class),
+		@JsonSubTypes.Type(value = VotingPhase.class) })
 public interface Phase {
 	public static final Long PHASE_MAXTIME = 30000l; // 30sec
@@ -28,9 +42,9 @@
 	 * handled by updating the PartyStates
 	 * 
-	 * @param prevPhases the list of all previous phases
-	 * @param actor      the real actor
-	 * @param action     the action submitted by actor, which this phase can
-	 *                   really handle.
-	 * @param now        the current time
+	 * @param actor  the real actor (may differ from the actor contained in the
+	 *               action)
+	 * @param action the action submitted by actor, which this phase can really
+	 *               handle.
+	 * @param now    the current time
 	 * @return new VotingPhase
 	 */
@@ -73,6 +87,6 @@
 	 * after {@link #finish()}
 	 * 
-	 * @param now      the curren time
-	 * @param duration the max duration of the next phase. Must be between
+	 * @param now      the current time
+	 * @param duration the max duration (ms) of the next phase. Must be between
 	 *                 {@link #PHASE_MINTIME} and {@link #PHASE_MAXTIME}. Also
 	 *                 make sure that now+duration is at most at the total
@@ -83,7 +97,5 @@
 
 	/**
-	 * Get the voting evaluator
-	 * 
-	 * @return
+	 * @return the voting evaluator
 	 */
 	public VotingEvaluator getEvaluator();
@@ -97,8 +109,6 @@
 
 	/**
-	 * @param now the current time
-	 * 
 	 * @return the party states. Notice that someone must call
-	 *         {@link PartyStates#finish(Set)} if passed the deadline.
+	 *         {@link PartyStates#finish()} if passed the deadline.
 	 */
 	public PartyStates getPartyStates();
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/VotingPhase.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/VotingPhase.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/phase/VotingPhase.java	(revision 24)
@@ -3,4 +3,8 @@
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 import geniusweb.actions.Action;
@@ -10,4 +14,5 @@
 import geniusweb.inform.Inform;
 import geniusweb.inform.Voting;
+import geniusweb.issuevalue.Bid;
 import geniusweb.protocol.ProtocolException;
 import geniusweb.protocol.session.mopac.PartyStates;
@@ -16,7 +21,16 @@
 public class VotingPhase extends DefaultPhase {
 
-	VotingPhase(Phase prevPhase, PartyStates partyStates, Long deadlinems,
-			VotingEvaluator evaluator) {
-		super(prevPhase, partyStates, deadlinems, evaluator);
+	/**
+	 * the offers received in the {@link OfferPhase}
+	 */
+	private final List<Bid> offers;
+
+	@JsonCreator
+	protected VotingPhase(@JsonProperty("offers") List<Bid> offers,
+			@JsonProperty("partyStates") PartyStates partyStates,
+			@JsonProperty("deadlinems") Long deadlinems,
+			@JsonProperty("evaluator") VotingEvaluator evaluator) {
+		super(partyStates, deadlinems, evaluator);
+		this.offers = offers;
 	}
 
@@ -28,5 +42,5 @@
 			return this.with(ex);
 		}
-		return new VotingPhase(prevPhase, partyStates.with(action), deadline,
+		return new VotingPhase(offers, partyStates.with(action), deadline,
 				evaluator);
 	}
@@ -34,11 +48,10 @@
 	@Override
 	public Inform getInform() {
-		return new Voting(((OfferPhase) prevPhase).getOffers(),
-				partyStates.getPowers());
+		return new Voting(offers, partyStates.getPowers());
 	}
 
 	@Override
 	public VotingPhase with(ProtocolException e) {
-		return new VotingPhase(prevPhase, partyStates.with(e), deadline,
+		return new VotingPhase(offers, partyStates.with(e), deadline,
 				evaluator);
 	}
@@ -46,5 +59,5 @@
 	@Override
 	public VotingPhase finish() {
-		return new VotingPhase(prevPhase, partyStates.finish(), deadline,
+		return new VotingPhase(offers, partyStates.finish(), deadline,
 				evaluator);
 	}
@@ -52,5 +65,6 @@
 	@Override
 	protected Phase checkedNext(long deadln) {
-		return new OptInPhase(this, partyStates.flush(), deadln, evaluator);
+		return new OptInPhase(getVotes(), partyStates.flush(), deadln,
+				evaluator);
 	}
 
@@ -60,3 +74,12 @@
 	}
 
+	/**
+	 * @return all votes done in this phase.
+	 */
+	public List<Votes> getVotes() {
+		return partyStates.getActions().stream()
+				.filter(act -> act instanceof Votes).map(act -> (Votes) act)
+				.collect(Collectors.toList());
+	}
+
 }
Index: /protocol/src/main/java/geniusweb/protocol/session/saop/SAOP.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/saop/SAOP.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/saop/SAOP.java	(revision 24)
@@ -38,11 +38,11 @@
 
 /**
- * 
- * All parties are first sent the {@link SessionSettings}. Only parties
- * specified initially in the settings do participate.
+ * The protocol runs as follows
  * <ol>
- * The protocol tries to start all parties. If not all parties start, the
+ * <li>The protocol tries to start all parties. If not all parties start, the
  * parties are freed up and another attempt is done to start all parties some
  * time later.
+ * <li>All parties are sent the {@link SessionSettings}. Only parties specified
+ * initially in the settings do participate.
  * <li>The session deadline clock now starts ticking.
  * <li>All parties are sent their settings.
@@ -61,5 +61,5 @@
  * the protocol.
  * <p>
- * Threadsafe: all entrypoints are synhronized.
+ * Thread safe: all entry points are synchronized.
  */
 public class SAOP extends DefaultListenable<ProtocolEvent>
@@ -79,5 +79,6 @@
 	/**
 	 * 
-	 * @param state normally the initial state coming from SAOPSettings
+	 * @param state  normally the initial state coming from SAOPSettings
+	 * @param logger the Reporter to log to
 	 */
 	public SAOP(SAOPState state, Reporter logger) {
Index: /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPSettings.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPSettings.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPSettings.java	(revision 24)
@@ -27,5 +27,5 @@
 	 *                     protocol. But SAOP can be initialized with less, for
 	 *                     use in TournamentSettings.
-	 * @param deadline
+	 * @param deadline     the deadline of the negotiation
 	 */
 	@JsonCreator
Index: /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/saop/SAOPState.java	(revision 24)
@@ -33,5 +33,5 @@
 	/**
 	 * 
-	 * @param actions
+	 * @param actions       the actions done by the parties
 	 * @param conns         the existing party connections. we assume ownership
 	 *                      of this so it should not be modified although
@@ -88,7 +88,5 @@
 	/**
 	 * 
-	 * @param e             the error that occured
-	 * @param currentTimeMs the current time in ms since 1970, see
-	 *                      {@link System#currentTimeMillis()}
+	 * @param e the error that occured
 	 * @return a new state with the error set.
 	 */
@@ -160,11 +158,9 @@
 
 	/**
-	 * @param actor         the actor that did this action. Can be used to check
-	 *                      if action is valid. NOTICE caller has to make sure
-	 *                      the current state is not final.
-	 * @param action        the action that was proposed by actor.
-	 * @param currentTimeMs the current time in ms since 1970, see
-	 *                      {@link System#currentTimeMillis()}
-	 * @return new SessionState with the action added as last action.
+	 * @param actor  the actor that did this action. Can be used to check if
+	 *               action is valid. NOTICE caller has to make sure the current
+	 *               state is not final.
+	 * @param action the action that was proposed by actor.
+	 * @return new SAOPState with the action added as last action.
 	 */
 
Index: /protocol/src/main/java/geniusweb/protocol/session/shaop/BareSHAOPState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/shaop/BareSHAOPState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/shaop/BareSHAOPState.java	(revision 24)
@@ -44,26 +44,26 @@
 	/**
 	 * 
-	 * @param actions    value for actions done so far. null equals to empty
-	 *                   list
-	 * @param conns      the currently existing connections. Can be empty/null.
-	 *                   Each connection represents another party. Normally the
-	 *                   connections are in the order SHAOP1,COB1,SHAOP2,COB2,..
-	 *                   so 2 parties for each team. The protocol should check
-	 *                   this.
-	 * @param progr      the {@link Progress} that governs this session. Can be
-	 *                   null if session did not yet start.
-	 * @param settings   the settings used for the session
-	 * @param e          the exception that occured, usually null. All errors
-	 *                   occuring due to faulty {@link Action}s translate to
-	 *                   {@link ProtocolException}s. All errors in our own code
-	 *                   are bugs (not ProtocolExceptions) and should result in
-	 *                   a throw.
-	 * @param teamNr     the teamnr (0,1,2..) that has the turn. 2* gives index
-	 *                   {@link #connections} and settings
-	 * @param partyNrs   a map for each known PartyId to a number. The number is
-	 *                   the index in both {@link SHAOPSettings#getTeams()} and
-	 *                   in {@link #connections}. null is empyt map.
-	 * @param totalSpent total accumulated elicitation costs so far. only SHAOP
-	 *                   parties accumulate costs. null = empty map
+	 * @param actions  value for actions done so far. null equals to empty list
+	 * @param conns    the currently existing connections. Can be empty/null.
+	 *                 Each connection represents another party. Normally the
+	 *                 connections are in the order SHAOP1,COB1,SHAOP2,COB2,..
+	 *                 so 2 parties for each team. The protocol should check
+	 *                 this.
+	 * @param progr    the {@link Progress} that governs this session. Can be
+	 *                 null if session did not yet start.
+	 * @param settings the settings used for the session
+	 * @param e        the exception that occured, usually null. All errors
+	 *                 occuring due to faulty {@link Action}s translate to
+	 *                 {@link ProtocolException}s. All errors in our own code
+	 *                 are bugs (not ProtocolExceptions) and should result in a
+	 *                 throw.
+	 * @param teamNr   the teamnr (0,1,2..) that has the turn. 2* gives index
+	 *                 {@link #connections} and settings
+	 * @param partyNrs a map for each known PartyId to a number. The number is
+	 *                 the index in both {@link SHAOPSettings#getTeams()} and in
+	 *                 {@link #connections}. null is empyt map.
+	 * @param spent    total accumulated elicitation costs so far for each
+	 *                 party. only SHAOP parties accumulate costs. null = empty
+	 *                 map
 	 */
 	@JsonCreator
Index: /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOP.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOP.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOP.java	(revision 24)
@@ -85,5 +85,6 @@
 	/**
 	 * 
-	 * @param state normally the initial state coming from SAOPSettings
+	 * @param state  normally the initial state coming from SAOPSettings
+	 * @param logger the {@link Reporter} to use
 	 */
 	public SHAOP(SHAOPState state, Reporter logger) {
Index: /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOPState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOPState.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/session/shaop/SHAOPState.java	(revision 24)
@@ -38,4 +38,23 @@
 	 * see {@link BareSHAOPState}.
 	 */
+	/**
+	 * 
+	 * @param actions       see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param conns         see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param progress      see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param settings      see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param e             see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param teamNr        see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param partytNumbers see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 * @param spent         see
+	 *                      {@link BareSHAOPState#BareSHAOPState(List, ProtocolToPartyConnections, Progress, SHAOPSettings, ProtocolException, int, Map, Map)}.
+	 */
 	@JsonCreator
 	public SHAOPState(@JsonProperty("actions") List<Action> actions,
@@ -72,6 +91,6 @@
 	/**
 	 * 
-	 * @param party
-	 * @return true iff party is a SHAOP party.
+	 * @param party the {@link PartyId} to test
+	 * @return true iff party is a SHAOP party (not a COB party).
 	 */
 	public boolean isShaopParty(PartyId party) {
@@ -81,5 +100,5 @@
 	/**
 	 * 
-	 * @return the team leader {@link PartyId}s.
+	 * @return the team leader {@link PartyId}s which are the SHAOP parties.
 	 */
 	private Set<PartyId> getLeaders() {
@@ -149,7 +168,5 @@
 	/**
 	 * 
-	 * @param e             the error that occured
-	 * @param currentTimeMs the current time in ms since 1970, see
-	 *                      {@link System#currentTimeMillis()}
+	 * @param e the error that occured
 	 * @return a new state with the error set.
 	 */
@@ -201,10 +218,8 @@
 
 	/**
-	 * @param actor         the actor that did this action. Can be used to check
-	 *                      if action is valid. NOTICE caller has to make sure
-	 *                      the current state is not final.
-	 * @param action        the action that was proposed by actor.
-	 * @param currentTimeMs the current time in ms since 1970, see
-	 *                      {@link System#currentTimeMillis()}
+	 * @param actor  the actor that did this action. Can be used to check if
+	 *               action is valid. NOTICE caller has to make sure the current
+	 *               state is not final.
+	 * @param action the action that was proposed by actor.
 	 * @return new SessionState with the action added as last action.
 	 */
Index: /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsProtocol.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsProtocol.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsProtocol.java	(revision 24)
@@ -34,5 +34,5 @@
 	/**
 	 * 
-	 * @param state
+	 * @param state  the {@link AllPermutationsState}
 	 * @param logger used for all logging, about the tournament, and the created
 	 *               the session and protocols.
@@ -81,6 +81,4 @@
 			long now = System.currentTimeMillis();
 			if (sessionstate.isFinal(now)) {
-				// List<TeamOfPartiesAndProfiles> participants =
-				// sessionstate.getSettings().getParticipants()
 				SessionResult result = sessionstate.getResult();
 				state = state.with(result);
Index: /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java	(revision 23)
+++ /protocol/src/main/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettings.java	(revision 24)
@@ -69,23 +69,21 @@
 	/**
 	 * 
-	 * @param teams             a list of {@link Team}s. Must contain at least
-	 *                          {@link #teamsPerSession} 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
-	 * @param numberTournaments the number of times the tournament should be
-	 *                          run.
+	 * @param teams           a list of {@link Team}s. Must contain at least
+	 *                        {@link #teamsPerSession} elements. The
+	 *                        {@link #teamsPerSession} 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
+	 *                        {@link #teamsPerSession} elements.
+	 * @param teamsPerSession number of parties per session, must be at least 2.
+	 * @param sesettings      The generic {@link SessionSettings}.
+	 *                        {@link SessionSettings#with(TeamOfPartiesAndProfiles)}
+	 *                        will be used to add the required
+	 *                        {@link TeamOfPartiesAndProfiles}s
+	 * @param nTournaments    the number of times the tournament should be run.
 	 */
 	@JsonCreator
Index: /protocol/src/test/java/geniusweb/protocol/session/amop/WillBeCalledTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/amop/WillBeCalledTest.java	(revision 24)
+++ /protocol/src/test/java/geniusweb/protocol/session/amop/WillBeCalledTest.java	(revision 24)
@@ -0,0 +1,37 @@
+package geniusweb.protocol.session.amop;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class WillBeCalledTest {
+	int counter;
+
+	@Test
+	public void testDeadline() throws InterruptedException {
+		counter = 0;
+		new WillBeCalled(() -> {
+			counter++;
+		}, 100l);
+		assertEquals(0, counter);
+		Thread.sleep(200);
+		assertEquals(1, counter);
+		Thread.sleep(200);
+		assertEquals(1, counter);
+
+	}
+
+	@Test
+	public void testManual() throws InterruptedException {
+		counter = 0;
+		WillBeCalled w = new WillBeCalled(() -> {
+			counter++;
+		}, 100l);
+		assertEquals(0, counter);
+		w.complete();
+		assertEquals(1, counter);
+		Thread.sleep(200);
+		assertEquals(1, counter);
+
+	}
+}
Index: /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java	(revision 24)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACStateTest.java	(revision 24)
@@ -0,0 +1,275 @@
+package geniusweb.protocol.session.mopac;
+
+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.OnePartyTeam;
+import geniusweb.protocol.session.mopac.phase.OfferPhase;
+import geniusweb.protocol.session.mopac.phase.Phase;
+import geniusweb.references.Parameters;
+import geniusweb.references.PartyWithParameters;
+import geniusweb.references.PartyWithProfile;
+import geniusweb.references.ProfileRef;
+import geniusweb.voting.votingevaluators.LargestAgreement;
+import tudelft.utilities.junit.GeneralTests;
+
+public class MOPACStateTest extends GeneralTests<MOPACState> {
+	private static final Date NOW = new Date(1001);
+
+	private final ObjectMapper jackson = new ObjectMapper();
+
+	private final MOPACSettings settings = mock(MOPACSettings.class);
+
+	private final MOPACState state = new MOPACState(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));
+
+	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\":{}}}}";
+	// 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 LargestAgreement());
+	private Phase phase2 = new OfferPhase(partyStates, 200l,
+			new LargestAgreement());
+	private Progress progress1 = new ProgressTime(100l, NOW);
+	private Progress progress2 = new ProgressTime(200l, NOW);
+
+	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\":{}}}";
+
+	@Before
+	public void before()
+			throws JsonParseException, JsonMappingException, IOException {
+		params1.put("power", 2);
+		when(partyparams1.getParameters()).thenReturn(params1);
+
+		MOPACSettings realsettings = jackson.readValue(mopacsettingstr,
+				MOPACSettings.class);
+		OnePartyTeam party = mock(OnePartyTeam.class);
+		PartyWithParameters pwithp = mock(PartyWithParameters.class);
+		when(pwithp.getParameters()).thenReturn(new Parameters());
+		when(party.getParty()).thenReturn(pwithp);
+		MOPACSettings realsettings2 = realsettings.with(party);
+
+		state1 = new MOPACState(phase1, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state1a = new MOPACState(phase1, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state2 = new MOPACState(phase2, Collections.emptyList(), progress1,
+				realsettings, Collections.emptyMap());
+		state3 = new MOPACState(phase1, Arrays.asList(mock(Action.class)),
+				progress1, realsettings, Collections.emptyMap());
+		state4 = new MOPACState(phase1, Collections.emptyList(), progress2,
+				realsettings, Collections.emptyMap());
+		state5 = new MOPACState(phase1, Collections.emptyList(), progress1,
+				realsettings2, Collections.emptyMap());
+		state6 = new MOPACState(phase1, Collections.emptyList(), progress1,
+				realsettings,
+				Collections.singletonMap(PARTY1, mock(PartyWithProfile.class)));
+
+	}
+
+	@Override
+	public List<List<MOPACState>> 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(
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*",
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*",
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*",
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*",
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*",
+				"MOPACState.*OfferPhase.*PartyStates.*,MOPACSettings.*PartyWithProfile.*ProgressTime.*");
+	}
+
+	@Test
+	public void smokeTest() {
+	}
+
+	@Test
+	public void addProfilesBeforeInit() {
+		MOPACState 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.
+		MOPACState 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() {
+		MOPACState st = state.initPhase(new ProgressTime(100l, new Date(0)), 1);
+		assertTrue(st.getAgreements().getMap().isEmpty());
+	}
+
+	@Test
+	public void testDeserialize() throws IOException {
+		MOPACState obj = jackson.readValue(serialized, MOPACState.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);
+		MOPACState s1 = new MOPACState(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);
+		MOPACState s1 = new MOPACState(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);
+		MOPACState s1 = new MOPACState(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);
+		MOPACState s1 = new MOPACState(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);
+
+		MOPACState 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);
+		MOPACState s1 = new MOPACState(phase, actions, progress, settings,
+				partyprofiles);
+
+		Phase exphase = mock(Phase.class); // supposed phase that contains the
+											// exception
+		when(phase.with(any(ProtocolException.class))).thenReturn(exphase);
+
+		MOPACState errstate = s1.with(new ProtocolException("test", PARTY1));
+		assertEquals(exphase, errstate.getPhase());
+		assertEquals(progress, errstate.getProgress());
+
+	}
+
+}
Index: /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java	(revision 23)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/MOPACTest.java	(revision 24)
@@ -2,7 +2,9 @@
 
 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;
@@ -12,8 +14,8 @@
 import java.io.IOException;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
@@ -28,4 +30,7 @@
 import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
 import geniusweb.protocol.partyconnection.ProtocolToPartyConnFactory;
+import geniusweb.protocol.session.mopac.phase.OfferPhase;
+import geniusweb.protocol.session.mopac.phase.Phase;
+import geniusweb.protocol.session.mopac.phase.VotingPhase;
 import tudelft.utilities.logging.Reporter;
 import tudelft.utilities.repository.NoResourcesNowException;
@@ -57,4 +62,6 @@
 			conn3 = mock(ProtocolToPartyConn.class);
 
+	private List<ProtocolToPartyConn> connections;
+
 	@Before
 	public void before() throws JsonParseException, JsonMappingException,
@@ -63,5 +70,5 @@
 		mopac = settings.getProtocol(logger);
 
-		List connections = Arrays.asList(conn1, conn2, conn3);
+		connections = Arrays.asList(conn1, conn2, conn3);
 		when(factory.connect(any(List.class))).thenReturn(connections);
 
@@ -94,5 +101,4 @@
 	}
 
-	@Ignore
 	@Test
 	public void testWorkingCheckDeadline()
@@ -101,14 +107,10 @@
 		mopac.start(factory);
 
-		System.out.println(mopac.getState());
-
+		assertFalse(mopac.getState().isFinal(System.currentTimeMillis()));
 		// we have deadline in 100ms so check
 		Thread.sleep(200);
-
-		System.out.println(mopac.getState());
 		assertTrue(mopac.getState().isFinal(System.currentTimeMillis()));
 	}
 
-	@Ignore
 	@Test
 	public void testSubscribedToConnections() {
@@ -119,5 +121,4 @@
 	}
 
-	@Ignore
 	@Test
 	public void testActionIsBroadcast()
@@ -134,7 +135,81 @@
 	}
 
-	@Test
-	public void testAgreementTerminates() {
-
-	}
+	/**
+	 * 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
+		MOPACState offerstate = mock(MOPACState.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);
+		MOPACState finalofferstate = mock(MOPACState.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();
+		MOPACState votingstate = mock(MOPACState.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 MOPAC(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/mopac/PartyStatesTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/PartyStatesTest.java	(revision 23)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/PartyStatesTest.java	(revision 24)
@@ -3,17 +3,25 @@
 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 {
+public class PartyStatesTest extends GeneralTests<PartyStates> {
+	private final ObjectMapper jackson = new ObjectMapper();
 
 	private final PartyId party1 = new PartyId("party1");
@@ -22,26 +30,49 @@
 
 	private final Map<PartyId, Integer> powers = new HashMap<>();
-	private final PartyStates states;
+	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);
-		states = new PartyStates(powers);
+		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(), states.getNegotiatingParties());
-		assertEquals(powers.keySet(), states.getNotYetActed());
-		assertEquals(0, states.getExceptions().size());
+		assertEquals(powers.keySet(), states1.getNegotiatingParties());
+		assertEquals(powers.keySet(), states1.getNotYetActed());
+		assertEquals(0, states1.getExceptions().size());
 	}
 
 	@Test
 	public void testException() {
-		PartyStates newstates = states
+		PartyStates newstates = states1
 				.with(new ProtocolException("bla", party1));
 		assertEquals(new Agreements(), newstates.getAgreements());
-		assertEquals(powers.keySet(), states.getNegotiatingParties());
+		assertEquals(powers.keySet(), states1.getNegotiatingParties());
 		assertEquals(new HashSet<>(Arrays.asList(party2, party3)),
 				newstates.getNotYetActed());
@@ -50,8 +81,32 @@
 	@Test
 	public void testFinish() {
-		PartyStates newstates = states.finish();
+		PartyStates newstates = states1.finish();
 		assertEquals(new Agreements(), newstates.getAgreements());
-		assertEquals(powers.keySet(), states.getNegotiatingParties());
+		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/mopac/phase/OfferPhaseTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/OfferPhaseTest.java	(revision 23)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/OfferPhaseTest.java	(revision 24)
@@ -4,24 +4,43 @@
 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.mopac.PartyStates;
 import geniusweb.voting.VotingEvaluator;
+import geniusweb.voting.votingevaluators.LargestAgreement;
+import geniusweb.voting.votingevaluators.LargestAgreementsLoop;
+import tudelft.utilities.junit.GeneralTests;
 
 /**
  * We also test defaultPhase here.
  */
-public class OfferPhaseTest {
-
+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");
@@ -29,20 +48,82 @@
 
 	private final Map<PartyId, Integer> powers = new HashMap<>();
-	private final PartyStates states;
-	private final VotingEvaluator evaluator = mock(VotingEvaluator.class);
-	private final OfferPhase phase;
+	private final PartyStates states, states2;
+	private final VotingEvaluator evaluator = new LargestAgreement();
+	private final VotingEvaluator evaluator2 = new LargestAgreementsLoop();
+	private final OfferPhase phase, phase1, phase1a, phase2, phase3, phase4;
+
+	// 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\":{\"LargestAgreement\":{}},\"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(null, states, 10l, evaluator);
-	}
-
-	@Test
-	public void isInitFinalTest() {
+		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);
+		phase4 = new OfferPhase(states, 10l, evaluator2);
+
+	}
+
+	@Override
+	public List<List<OfferPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3),
+				Arrays.asList(phase4));
+	}
+
+	@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.*",
+				"OfferPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreementsLoop.*");
+	}
+
+	@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));
 	}
 
@@ -65,3 +146,132 @@
 	}
 
+	@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<Bid> offs = phase.with(party1, offer, 1).getOffers();
+		assertEquals(Arrays.asList(bid), offs);
+	}
+
+	@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/mopac/phase/OptInPhaseTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/OptInPhaseTest.java	(revision 24)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/OptInPhaseTest.java	(revision 24)
@@ -0,0 +1,203 @@
+package geniusweb.protocol.session.mopac.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.Votes;
+import geniusweb.inform.OptIn;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.mopac.PartyStates;
+import geniusweb.voting.VotingEvaluator;
+import geniusweb.voting.votingevaluators.LargestAgreement;
+import geniusweb.voting.votingevaluators.LargestAgreementsLoop;
+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 VotingEvaluator evaluator = new LargestAgreement();
+	private final VotingEvaluator evaluator2 = new LargestAgreementsLoop();
+	private final OptInPhase phase, phase1, phase1a, phase2, phase3, phase4;
+
+	// just a test bid
+	private final Bid bid = new Bid("issue", new DiscreteValue("yes"));
+	private final Vote vote = new Vote(party1, bid, 2, 3);
+	private final Votes votes = new Votes(party1, Arrays.asList(vote));
+
+	private final List<Votes> 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);
+		phase4 = new OptInPhase(null, states, 10l, evaluator2);
+
+	}
+
+	@Override
+	public List<List<OptInPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3),
+				Arrays.asList(phase4));
+	}
+
+	@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.*",
+				"OptInPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreementsLoop.*");
+	}
+
+	@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 OptIn(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.emptyList()),
+				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, Arrays.asList(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/mopac/phase/VotingPhaseTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/VotingPhaseTest.java	(revision 24)
+++ /protocol/src/test/java/geniusweb/protocol/session/mopac/phase/VotingPhaseTest.java	(revision 24)
@@ -0,0 +1,193 @@
+package geniusweb.protocol.session.mopac.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.Votes;
+import geniusweb.inform.Voting;
+import geniusweb.issuevalue.Bid;
+import geniusweb.issuevalue.DiscreteValue;
+import geniusweb.protocol.ProtocolException;
+import geniusweb.protocol.session.mopac.PartyStates;
+import geniusweb.voting.VotingEvaluator;
+import geniusweb.voting.votingevaluators.LargestAgreement;
+import geniusweb.voting.votingevaluators.LargestAgreementsLoop;
+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 VotingEvaluator evaluator = new LargestAgreement();
+	private final VotingEvaluator evaluator2 = new LargestAgreementsLoop();
+	private final VotingPhase phase, phase1, phase1a, phase2, phase3, phase4;
+
+	// just a test bid
+	private final Bid bid = new Bid("issue", new DiscreteValue("yes"));
+	private final Vote vote = new Vote(party1, bid, 2, 3);
+	private final Votes votes = new Votes(party1, Arrays.asList(vote));
+
+	private final List<Bid> prevPhase = Arrays.asList(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);
+		phase4 = new VotingPhase(null, states, 10l, evaluator2);
+
+	}
+
+	@Override
+	public List<List<VotingPhase>> getGeneralTestData() {
+		return Arrays.asList(Arrays.asList(phase1, phase1a),
+				Arrays.asList(phase2), Arrays.asList(phase3),
+				Arrays.asList(phase4));
+	}
+
+	@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.*",
+				"VotingPhase.*PartyStates.*party2, party1, party3.*\\[\\],Agreements.*\\[\\],\\{\\}.*],10,LargestAgreementsLoop.*");
+	}
+
+	@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(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(party1, new Votes(party2, Collections.emptyList()),
+				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<Votes> 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/SAOPTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java	(revision 23)
+++ /protocol/src/test/java/geniusweb/protocol/session/saop/SAOPTest.java	(revision 24)
@@ -34,4 +34,5 @@
 import geniusweb.events.CurrentState;
 import geniusweb.events.ProtocolEvent;
+import geniusweb.inform.Agreements;
 import geniusweb.inform.Finished;
 import geniusweb.inform.Inform;
@@ -177,4 +178,5 @@
 		when(state.toString()).thenReturn(asText);
 		when(state.with(any(ProtocolException.class))).thenReturn(failstate);
+		when(state.getAgreements()).thenReturn(mock(Agreements.class));
 	}
 
@@ -260,5 +262,4 @@
 	@Test
 	public void testActionRequestWrongActor() {
-
 		saop.actionRequest(conn2, mock(EndNegotiation.class));
 
@@ -290,4 +291,5 @@
 		when(state.with(any(PartyId.class), any(EndNegotiation.class)))
 				.thenReturn(finalstate);
+		// when(finalstate.getAgreements()).thenReturn(mock(Agreements.class));
 
 		saop.actionRequest(conn1, mock(EndNegotiation.class));
@@ -311,5 +313,7 @@
 		doThrow(new IOException("fail sending yourturn")).when(conn1)
 				.send(any(YourTurn.class));
-
+		// CHECK is the state really final after an exception?
+		when(state.with(any(ProtocolException.class))).thenReturn(finalstate);
+		// when(state.getAgreements()).thenReturn(mock(Agreements.class));
 		saop.actionRequest(conn1, mock(Accept.class));
 
@@ -322,4 +326,5 @@
 		doThrow(new IOException("fail sending yourturn")).when(conn1)
 				.send(any(YourTurn.class));
+		// when(failstate.getAgreements()).thenReturn(mock(Agreements.class));
 		// not turn of conn2.
 		saop.actionRequest(conn2, mock(EndNegotiation.class));
@@ -332,4 +337,5 @@
 	public void testActionInFinalState() throws IOException {
 		saop = new SAOP(finalstate, new ReportToLogger("test"));
+		// when(finalstate.getAgreements()).thenReturn(mock(Agreements.class));
 
 		saop.actionRequest(conn1, mock(Offer.class));
Index: /pythonadapter/pom.xml
===================================================================
--- /pythonadapter/pom.xml	(revision 23)
+++ /pythonadapter/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>pythonadapter</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -81,5 +81,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -88,8 +88,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /pythonadapter/src/main/java/geniusweb/pythonadapter/PythonPartyAdapter.java
===================================================================
--- /pythonadapter/src/main/java/geniusweb/pythonadapter/PythonPartyAdapter.java	(revision 23)
+++ /pythonadapter/src/main/java/geniusweb/pythonadapter/PythonPartyAdapter.java	(revision 24)
@@ -36,5 +36,4 @@
  * </ul>
  * 
- * <p>
  * <h1>Working principle</h1>
  * 
Index: /references/pom.xml
===================================================================
--- /references/pom.xml	(revision 23)
+++ /references/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>references</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -152,5 +152,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -159,8 +159,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /references/src/main/java/geniusweb/connection/DefaultConnection.java
===================================================================
--- /references/src/main/java/geniusweb/connection/DefaultConnection.java	(revision 23)
+++ /references/src/main/java/geniusweb/connection/DefaultConnection.java	(revision 24)
@@ -6,10 +6,10 @@
  * Default implementation of connection. Connection implementors only need to
  * implement the send (which moves the data sent into the connection to the
- * other side) and they can call {@link DefaultListenable#notifyChange(Object)}
- * to inform the users of the connection that something came in from the other
- * side.
+ * other side) and they can call
+ * {@link DefaultListenable#notifyListeners(Object)} to inform the users of the
+ * connection that something came in from the other side.
  *
- * @param <INTYPE> the datatype of objects received from the other side
- * @param <OUTTYPE> the datatype of objects sent to the other side.
+ * @param INTYPE  the datatype of objects received from the other side
+ * @param OUTTYPE the datatype of objects sent to the other side.
  */
 public abstract class DefaultConnection<INTYPE, OUTTYPE> extends
Index: /simplerunner/pom.xml
===================================================================
--- /simplerunner/pom.xml	(revision 23)
+++ /simplerunner/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>simplerunner</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -139,5 +139,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -146,8 +146,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java
===================================================================
--- /simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java	(revision 23)
+++ /simplerunner/src/main/java/geniusweb/simplerunner/BasicConnection.java	(revision 24)
@@ -43,5 +43,5 @@
 	 * from us. Must be called first.
 	 * 
-	 * @param handler a Listener<OUT> that can handle send actions.
+	 * @param newhandler a Listener&lt;OUT&gt; that can handle send actions.
 	 * 
 	 */
Index: /simplerunner/src/main/java/geniusweb/simplerunner/NegoRunner.java
===================================================================
--- /simplerunner/src/main/java/geniusweb/simplerunner/NegoRunner.java	(revision 23)
+++ /simplerunner/src/main/java/geniusweb/simplerunner/NegoRunner.java	(revision 24)
@@ -36,7 +36,7 @@
 	/**
 	 * 
-	 * @param settings
-	 * @param connectionfactory
-	 * @param logger
+	 * @param settings          the {@link NegoSettings}
+	 * @param connectionfactory the {@link ProtocolToPartyConnFactory}
+	 * @param logger            the {@link Reporter} to log problems
 	 * @param maxruntime        limit in millisecs. Ignored if 0
 	 */
@@ -54,4 +54,8 @@
 	}
 
+	/**
+	 * 
+	 * @return true if the runner has finished
+	 */
 	public boolean isProperlyStopped() {
 		return properlyStopped;
@@ -88,8 +92,8 @@
 	/**
 	 * Separate so that we can intercept this when mocking, as this will crash
-	 * on mocks
+	 * on mocks because {@link #jackson} can not handle mocks.
 	 * 
-	 * @param level
-	 * @param state
+	 * @param level the log {@link Level}
+	 * @param state the {@link NegoState} to log
 	 */
 	protected void logFinal(Level level, NegoState state) {
@@ -102,4 +106,10 @@
 	}
 
+	/**
+	 * The main runner
+	 * 
+	 * @param args should have 1 argument, the settings.json file to be used.
+	 * @throws IOException if problem occurs
+	 */
 	public static void main(String[] args) throws IOException {
 		if (args.length != 1) {
Index: /timeline/pom.xml
===================================================================
--- /timeline/pom.xml	(revision 23)
+++ /timeline/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>timeline</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -16,5 +16,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -140,5 +140,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -147,8 +147,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /timeline/src/main/java/geniusweb/progress/ProgressTime.java
===================================================================
--- /timeline/src/main/java/geniusweb/progress/ProgressTime.java	(revision 23)
+++ /timeline/src/main/java/geniusweb/progress/ProgressTime.java	(revision 24)
@@ -38,8 +38,8 @@
 	/**
 	 * 
-	 * @param duration the duration, eg {@link DeadlineTime#getDuration()}. Must
-	 *                 be >0.
-	 * @param start    the start Date (unix time in millisecs since 1970). See
-	 *                 {@link System#currentTimeMillis()}.
+	 * @param d     the duration, eg {@link DeadlineTime#getDuration()}. Must be
+	 *              &gt; 0.
+	 * @param start the start Date (unix time in millisecs since 1970). See
+	 *              {@link System#currentTimeMillis()}.
 	 */
 	@JsonCreator
Index: /voting/pom.xml
===================================================================
--- /voting/pom.xml	(revision 23)
+++ /voting/pom.xml	(revision 24)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>voting</artifactId>
-	<version>1.5.2</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.3</version> <!-- must equal ${geniusweb.version} -->
 	<packaging>jar</packaging>
 
@@ -17,5 +17,5 @@
 		<passwd>${env.ARTIFACTORY_PASS}</passwd>
 		<jackson-2-version>2.9.10</jackson-2-version>
-		<geniusweb.version>1.5.2</geniusweb.version>
+		<geniusweb.version>1.5.3</geniusweb.version>
 	</properties>
 
@@ -156,5 +156,5 @@
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
-				<version>2.10.1</version>
+				<version>3.2.0</version>
 				<executions>
 					<execution>
@@ -163,8 +163,4 @@
 							<goal>jar</goal>
 						</goals>
-						<configuration>
-							<additionalparam>${javadoc.opts}</additionalparam>
-							<additionalparam>-Xdoclint:none</additionalparam>
-						</configuration>
 					</execution>
 				</executions>
Index: /voting/src/main/java/geniusweb/voting/CollectedVotes.java
===================================================================
--- /voting/src/main/java/geniusweb/voting/CollectedVotes.java	(revision 23)
+++ /voting/src/main/java/geniusweb/voting/CollectedVotes.java	(revision 24)
@@ -176,5 +176,5 @@
 
 	/**
-	 * @param voteList
+	 * @param voteList list of all {@link Vote}s
 	 * @return all parties that did a vote
 	 */
Index: /voting/src/main/java/geniusweb/voting/VotingEvaluator.java
===================================================================
--- /voting/src/main/java/geniusweb/voting/VotingEvaluator.java	(revision 23)
+++ /voting/src/main/java/geniusweb/voting/VotingEvaluator.java	(revision 24)
@@ -16,6 +16,5 @@
  * 
  * Implementations should be immutable and not serialize internal variables (eg
- * 
- * @JsonIgnore them).
+ * &#64;JsonIgnore them).
  */
 @JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
Index: /voting/src/main/java/geniusweb/voting/votingevaluators/LargestAgreementsLoop.java
===================================================================
--- /voting/src/main/java/geniusweb/voting/votingevaluators/LargestAgreementsLoop.java	(revision 23)
+++ /voting/src/main/java/geniusweb/voting/votingevaluators/LargestAgreementsLoop.java	(revision 24)
@@ -88,7 +88,11 @@
 	}
 
+	/**
+	 * WARNING you must manually set prime=37 here to fix collision with
+	 * {@link LargestAgreement}.
+	 */
 	@Override
 	public int hashCode() {
-		final int prime = 31;
+		final int prime = 37;
 		int result = 1;
 		result = prime * result
