Index: /bidspace/pom.xml
===================================================================
--- /bidspace/pom.xml	(revision 21)
+++ /bidspace/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>bidspace</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /boa/pom.xml
===================================================================
--- /boa/pom.xml	(revision 21)
+++ /boa/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>boa</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /collectparties.sh
===================================================================
--- /collectparties.sh	(revision 21)
+++ /collectparties.sh	(revision 22)
@@ -7,5 +7,5 @@
 rm -rf collectedparties
 mkdir collectedparties
-VERSION=1.5.0
+VERSION=1.5.1
 
 cp "exampleparties/anac2019/agentgg/target/agentgg-${VERSION}-jar-with-dependencies.jar" collectedparties
Index: /events/pom.xml
===================================================================
--- /events/pom.xml	(revision 21)
+++ /events/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>events</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /events/src/main/java/geniusweb/actions/Vote.java
===================================================================
--- /events/src/main/java/geniusweb/actions/Vote.java	(revision 21)
+++ /events/src/main/java/geniusweb/actions/Vote.java	(revision 22)
@@ -14,4 +14,5 @@
 public class Vote extends ActionWithBid {
 	private final Integer minPower;
+	private final Integer maxPower;
 
 	/**
@@ -19,15 +20,22 @@
 	 * @param bid      the bid that is voted on
 	 * @param minPower the minimum power this bid must get in order for the vote
-	 *                 to be valid. If power=1 for all participants (usually the
-	 *                 default) power can be interpreted as number of votes
+	 *                 to be valid. Power is the sum of the powers of the
+	 *                 parties that are in the deal. If power=1 for all
+	 *                 participants (usually the default) power can be
+	 *                 interpreted as number of votes
+	 * @param maxPower the maximum power this bid must get in order for the vote
+	 *                 to be valid. See {@link #minPower}
 	 */
 	@JsonCreator
 	public Vote(@JsonProperty("actor") PartyId id, @JsonProperty("bid") Bid bid,
-			@JsonProperty("minPower") Integer minPower) {
+			@JsonProperty("minPower") Integer minPower,
+			@JsonProperty("maxPower") Integer maxPower) {
 		super(id, bid);
 		this.minPower = minPower;
-		if (bid == null || minPower == null || minPower < 1) {
+		this.maxPower = maxPower;
+		if (bid == null || minPower == null || minPower < 1 || maxPower == null
+				|| maxPower < minPower) {
 			throw new IllegalArgumentException(
-					"Vote must have non-null bid and minVotes, and minVotes must be >=1");
+					"Vote must have non-null bid and minVotes, and minPower must be >=1 and maxPower must be >=minPower");
 		}
 	}
@@ -35,6 +43,6 @@
 	/**
 	 * 
-	 * @return the minimum number of votes this bid must get in order for the
-	 *         vote to be valid.
+	 * @return the minimum power this bid must get in order for the vote to be
+	 *         valid.
 	 */
 	public Integer getMinPower() {
@@ -42,7 +50,18 @@
 	}
 
+	/**
+	 * 
+	 * @return the max power this bid must get in order for the vote to be
+	 *         valid.
+	 */
+
+	public Integer getMaxPower() {
+		return maxPower;
+	}
+
 	@Override
 	public String toString() {
-		return "Vote[" + getActor() + "," + getBid() + "," + minPower + "]";
+		return "Vote[" + getActor() + "," + getBid() + "," + minPower + ","
+				+ maxPower + "]";
 	}
 
@@ -51,4 +70,6 @@
 		final int prime = 31;
 		int result = super.hashCode();
+		result = prime * result
+				+ ((maxPower == null) ? 0 : maxPower.hashCode());
 		result = prime * result
 				+ ((minPower == null) ? 0 : minPower.hashCode());
@@ -65,4 +86,9 @@
 			return false;
 		Vote other = (Vote) obj;
+		if (maxPower == null) {
+			if (other.maxPower != null)
+				return false;
+		} else if (!maxPower.equals(other.maxPower))
+			return false;
 		if (minPower == null) {
 			if (other.minPower != null)
Index: /events/src/test/java/actions/PartyIdTest.java
===================================================================
--- /events/src/test/java/actions/PartyIdTest.java	(revision 21)
+++ /events/src/test/java/actions/PartyIdTest.java	(revision 22)
@@ -26,4 +26,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testRestrictions() {
@@ -31,4 +32,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testRestrictions2() {
@@ -36,4 +38,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testRestrictions3() {
@@ -41,4 +44,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testRestrictions4() {
@@ -46,4 +50,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testRestrictions5() {
@@ -56,4 +61,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void testRestrictions6() {
@@ -61,4 +67,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void testRestrictions7() {
Index: /events/src/test/java/actions/PartyIdTest1.java
===================================================================
--- /events/src/test/java/actions/PartyIdTest1.java	(revision 21)
+++ /events/src/test/java/actions/PartyIdTest1.java	(revision 22)
@@ -43,4 +43,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void smokeTest() throws URISyntaxException {
@@ -48,4 +49,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void nullTest() throws URISyntaxException {
Index: /events/src/test/java/actions/VoteTest.java
===================================================================
--- /events/src/test/java/actions/VoteTest.java	(revision 21)
+++ /events/src/test/java/actions/VoteTest.java	(revision 22)
@@ -6,5 +6,4 @@
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -39,7 +38,7 @@
 	private final static Value VALUE2 = new NumberValue("10");
 	// issue 2 is NUMBER and thus serializes with leading '='
-	private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1}}";
+	private final String votestring = "{\"vote\":{\"actor\":\"party1\",\"bid\":{\"issuevalues\":{\"issue2\":10,\"issue1\":\"value1\"}},\"minPower\":1,\"maxPower\":2}}";
 
-	private static Vote vote1, vote1a, vote2, vote3, vote4;
+	private static Vote vote1, vote1a, vote2, vote3, vote4, vote5;
 
 	static {
@@ -47,8 +46,8 @@
 		issuevalues.put(ISSUE2, VALUE2);
 		bid = new Bid(issuevalues);
-		vote1 = new Vote(id, bid, 1);
-		vote1a = new Vote(id, bid, 1);
+		vote1 = new Vote(id, bid, 1, 2);
+		vote1a = new Vote(id, bid, 1, 2);
 
-		vote2 = new Vote(id2, bid, 1);
+		vote2 = new Vote(id2, bid, 1, 2);
 
 		// values swapped, so different issuevalues.
@@ -56,7 +55,8 @@
 		issuevaluesb.put(ISSUE2, VALUE2);
 		bidb = new Bid(issuevaluesb);
-		vote3 = new Vote(id, bidb, 1);
+		vote3 = new Vote(id, bidb, 1, 2);
 
-		vote4 = new Vote(id, bid, 2);
+		vote4 = new Vote(id, bid, 2, 2);
+		vote5 = new Vote(id, bid, 1, 3);
 
 	}
@@ -64,18 +64,16 @@
 	@Override
 	public List<List<Vote>> getGeneralTestData() {
-		List<List<Vote>> list = new LinkedList<>();
-		list.add(Arrays.asList(vote1, vote1a));
-		list.add(Arrays.asList(vote2));
-		list.add(Arrays.asList(vote3));
-		list.add(Arrays.asList(vote4));
-		return list;
+		return Arrays.asList(Arrays.asList(vote1, vote1a), Arrays.asList(vote2),
+				Arrays.asList(vote3), Arrays.asList(vote4),
+				Arrays.asList(vote5));
 	}
 
 	@Override
 	public List<String> getGeneralTestStrings() {
-		return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*",
-				"Vote.*party2.*issue2=10.*issue1=.value1.*1.*",
-				"Vote.*party1.*issue2=10.*issue1=10.*1.*",
-				"Vote.*party1.*issue2=10.*issue1=.value1.*2.*");
+		return Arrays.asList("Vote.*party1.*issue2=10.*issue1=.value1.*1.*2.*",
+				"Vote.*party2.*issue2=10.*issue1=.value1.*1.*2.*",
+				"Vote.*party1.*issue2=10.*issue1=10.*1.*2.*",
+				"Vote.*party1.*issue2=10.*issue1=.value1.*2.*2.*",
+				"Vote.*party1.*issue2=10.*issue1=.value1.*1.*3.*");
 	}
 
Index: /events/src/test/java/actions/VotesTest.java
===================================================================
--- /events/src/test/java/actions/VotesTest.java	(revision 21)
+++ /events/src/test/java/actions/VotesTest.java	(revision 22)
@@ -24,5 +24,5 @@
 public class VotesTest extends GeneralTests<Votes> {
 	private final ObjectMapper jackson = new ObjectMapper();
-	private final String votestring = "{\"Votes\":{\"actor\":\"partyA\",\"votes\":[{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"is1\":\"val1\"}},\"minPower\":2}},{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"is1\":\"val2\"}},\"minPower\":2}}]}}";
+	private final String votestring = "{\"Votes\":{\"actor\":\"partyA\",\"votes\":[{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"is1\":\"val1\"}},\"minPower\":2,\"maxPower\":9}},{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"is1\":\"val2\"}},\"minPower\":2,\"maxPower\":9}}]}}";
 
 	private PartyId partyA = new PartyId("partyA");
@@ -30,8 +30,8 @@
 	private Bid bid1 = new Bid("is1", new DiscreteValue("val1")),
 			bid2 = new Bid("is1", new DiscreteValue("val2"));
-	private Vote voteA1 = new Vote(partyA, bid1, 2);
-	private Vote voteA2 = new Vote(partyA, bid2, 2);
-	private Vote voteB1 = new Vote(partyB, bid1, 2);
-	private Vote voteB2 = new Vote(partyB, bid2, 2);
+	private Vote voteA1 = new Vote(partyA, bid1, 2, 9);
+	private Vote voteA2 = new Vote(partyA, bid2, 2, 9);
+	private Vote voteB1 = new Vote(partyB, bid1, 2, 9);
+	private Vote voteB2 = new Vote(partyB, bid2, 2, 9);
 
 	private Votes votes1 = new Votes(partyA, Arrays.asList(voteA1, voteA2));
@@ -95,5 +95,5 @@
 	@Test
 	public void isExtendingTestLessPower() {
-		Vote powervoteA1 = new Vote(partyA, bid1, 3);
+		Vote powervoteA1 = new Vote(partyA, bid1, 3, 9);
 		Votes powerVotes = new Votes(partyA, Arrays.asList(powervoteA1));
 		assertFalse(powerVotes.isExtending(votes1));
@@ -103,5 +103,5 @@
 	@Test(expected = IllegalArgumentException.class)
 	public void testDuplicateBidsNotAllowed() {
-		Vote voteA1similar = new Vote(partyA, bid1, 3);
+		Vote voteA1similar = new Vote(partyA, bid1, 3, 9);
 		Votes votes = new Votes(partyA, Arrays.asList(voteA1, voteA1similar));
 	}
Index: /exampleparties/anac2019/agentgg/pom.xml
===================================================================
--- /exampleparties/anac2019/agentgg/pom.xml	(revision 21)
+++ /exampleparties/anac2019/agentgg/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties.anac2019</groupId>
 	<artifactId>agentgg</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/anac2019/winkyagent/pom.xml
===================================================================
--- /exampleparties/anac2019/winkyagent/pom.xml	(revision 21)
+++ /exampleparties/anac2019/winkyagent/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties.anac2019</groupId>
 	<artifactId>winkyagent</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/boulware/pom.xml
===================================================================
--- /exampleparties/boulware/pom.xml	(revision 21)
+++ /exampleparties/boulware/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>boulware</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/comparebids/pom.xml
===================================================================
--- /exampleparties/comparebids/pom.xml	(revision 21)
+++ /exampleparties/comparebids/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>comparebids</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/conceder/pom.xml
===================================================================
--- /exampleparties/conceder/pom.xml	(revision 21)
+++ /exampleparties/conceder/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>conceder</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/hardliner/pom.xml
===================================================================
--- /exampleparties/hardliner/pom.xml	(revision 21)
+++ /exampleparties/hardliner/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>hardliner</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/humangui/pom.xml
===================================================================
--- /exampleparties/humangui/pom.xml	(revision 21)
+++ /exampleparties/humangui/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>humangui</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/linear/pom.xml
===================================================================
--- /exampleparties/linear/pom.xml	(revision 21)
+++ /exampleparties/linear/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>linear</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/randomparty/pom.xml
===================================================================
--- /exampleparties/randomparty/pom.xml	(revision 21)
+++ /exampleparties/randomparty/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>randomparty</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java
===================================================================
--- /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java	(revision 21)
+++ /exampleparties/randomparty/src/main/java/geniusweb/exampleparties/randomparty/RandomParty.java	(revision 22)
@@ -39,7 +39,17 @@
  * A simple party that places random bids and accepts when it receives an offer
  * with sufficient utility.
- * <h2>voting</h2> If the party receives a parameter "minPower", it will
- * {@link Vote} using that minPower instead of the default value 2 if it
- * receives a {@link Voting} request.
+ * <h2>parameters</h2>
+ * <table>
+ * <tr>
+ * <td>minPower</td>
+ * <td>This value is used as minPower for placed {@link Vote}s. Default value is
+ * 2.</td>
+ * </tr>
+ * <tr>
+ * <td>maxPower</td>
+ * <td>This value is used as maxPower for placed {@link Vote}s. Default value is
+ * infinity.</td>
+ * </tr>
+ * </table>
  */
 public class RandomParty extends DefaultParty {
@@ -109,5 +119,6 @@
 	@Override
 	public String getDescription() {
-		return "places random bids until it can accept an offer with utility >0.6";
+		return "places random bids until it can accept an offer with utility >0.6. "
+				+ "Parameters minPower and maxPower can be used to control voting behaviour.";
 	}
 
@@ -164,12 +175,13 @@
 	 */
 	private Votes vote(Voting voting) throws IOException {
-		Object val = settings.getParameters().get("minPowwer");
-		Integer n = (val instanceof Integer) ? (Integer) val : 2;
-		for (Bid bid : voting.getBids()) {
-			System.out.println("Bid " + bid + "="
-					+ ((UtilitySpace) profileint.getProfile()).getUtility(bid));
-		}
+		Object val = settings.getParameters().get("minPower");
+		Integer minpower = (val instanceof Integer) ? (Integer) val : 2;
+		val = settings.getParameters().get("maxPower");
+		Integer maxpower = (val instanceof Integer) ? (Integer) val
+				: Integer.MAX_VALUE;
+
 		List<Vote> votes = voting.getBids().stream().distinct()
-				.filter(bid -> isGood(bid)).map(bid -> new Vote(me, bid, n))
+				.filter(bid -> isGood(bid))
+				.map(bid -> new Vote(me, bid, minpower, maxpower))
 				.collect(Collectors.toList());
 		return new Votes(me, votes);
Index: /exampleparties/randompartypy/pom.xml
===================================================================
--- /exampleparties/randompartypy/pom.xml	(revision 21)
+++ /exampleparties/randompartypy/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>randompyparty</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/simpleboa/pom.xml
===================================================================
--- /exampleparties/simpleboa/pom.xml	(revision 21)
+++ /exampleparties/simpleboa/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>simpleboaparty</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/simpleshaop/pom.xml
===================================================================
--- /exampleparties/simpleshaop/pom.xml	(revision 21)
+++ /exampleparties/simpleshaop/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>simpleshaop</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /exampleparties/timedependentparty/pom.xml
===================================================================
--- /exampleparties/timedependentparty/pom.xml	(revision 21)
+++ /exampleparties/timedependentparty/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb.exampleparties</groupId>
 	<artifactId>timedependentparty</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /issuevalue/pom.xml
===================================================================
--- /issuevalue/pom.xml	(revision 21)
+++ /issuevalue/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>issuevalue</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /issuevalue/src/test/java/geniusweb/issuevalue/BidTest.java
===================================================================
--- /issuevalue/src/test/java/geniusweb/issuevalue/BidTest.java	(revision 21)
+++ /issuevalue/src/test/java/geniusweb/issuevalue/BidTest.java	(revision 22)
@@ -83,4 +83,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void bidTestSimple() {
@@ -89,4 +90,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void bidTestNull() {
@@ -96,4 +98,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void bidTestOkIssueValue() {
@@ -148,4 +151,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void smokeTestConstructor2() {
@@ -153,4 +157,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void smokeTestConstructor2b() {
@@ -158,4 +163,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = NullPointerException.class)
 	public void smokeTestConstructor2Null1() {
@@ -163,4 +169,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = NullPointerException.class)
 	public void smokeTestConstructor2Null2() {
Index: /issuevalue/src/test/java/geniusweb/issuevalue/NumberValueTest.java
===================================================================
--- /issuevalue/src/test/java/geniusweb/issuevalue/NumberValueTest.java	(revision 21)
+++ /issuevalue/src/test/java/geniusweb/issuevalue/NumberValueTest.java	(revision 22)
@@ -17,6 +17,4 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-import geniusweb.issuevalue.NumberValue;
-import geniusweb.issuevalue.Value;
 import tudelft.utilities.junit.GeneralTests;
 
@@ -88,5 +86,7 @@
 	public void testDeserializeShorts() throws IOException {
 		ObjectMapper jackson = new ObjectMapper();
-		ArrayList list = jackson.readValue("[1,2,3,4,5]", ArrayList.class);
+		@SuppressWarnings("unchecked")
+		ArrayList<Integer> list = jackson.readValue("[1,2,3,4,5]",
+				ArrayList.class);
 		System.out.println(list);
 		System.out.println(list.get(0).getClass());
@@ -97,5 +97,6 @@
 	public void testDeserializeMix() throws IOException {
 		ObjectMapper jackson = new ObjectMapper();
-		ArrayList list = jackson.readValue("[\"short\",1,2,3,4,5]",
+		@SuppressWarnings("unchecked")
+		ArrayList<Object> list = jackson.readValue("[\"short\",1,2,3,4,5]",
 				ArrayList.class);
 		System.out.println(list);
Index: /opponentmodel/pom.xml
===================================================================
--- /opponentmodel/pom.xml	(revision 21)
+++ /opponentmodel/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>opponentmodel</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /party/pom.xml
===================================================================
--- /party/pom.xml	(revision 21)
+++ /party/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>party</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /party/src/test/java/geniusweb/party/inform/ActionDoneTest.java
===================================================================
--- /party/src/test/java/geniusweb/party/inform/ActionDoneTest.java	(revision 21)
+++ /party/src/test/java/geniusweb/party/inform/ActionDoneTest.java	(revision 22)
@@ -76,4 +76,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void nullTest() throws URISyntaxException {
Index: /party/src/test/java/geniusweb/party/inform/OptInTest.java
===================================================================
--- /party/src/test/java/geniusweb/party/inform/OptInTest.java	(revision 21)
+++ /party/src/test/java/geniusweb/party/inform/OptInTest.java	(revision 22)
@@ -30,7 +30,7 @@
 	private PartyId partyB = new PartyId("partyB");
 
-	private final Vote voteA1 = new Vote(partyA, bid1, 2);
-	private final Vote voteB1 = new Vote(partyB, bid1, 2);
-	private final Vote voteB2 = new Vote(partyB, bid2, 2);
+	private final Vote voteA1 = new Vote(partyA, bid1, 2, 9);
+	private final Vote voteB1 = new Vote(partyB, bid1, 2, 9);
+	private final Vote voteB2 = new Vote(partyB, bid2, 2, 9);
 
 	private Votes votesA = new Votes(partyA, Arrays.asList(voteA1));
@@ -41,5 +41,5 @@
 	private final OptIn optIn2 = new OptIn(Arrays.asList(votesA));
 
-	private String asJson = "{\"OptIn\":{\"votes\":[{\"Votes\":{\"actor\":\"partyA\",\"votes\":[{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"iss\":\"val1\"}},\"minPower\":2}}]}},{\"Votes\":{\"actor\":\"partyB\",\"votes\":[{\"vote\":{\"actor\":\"partyB\",\"bid\":{\"issuevalues\":{\"iss\":\"val1\"}},\"minPower\":2}},{\"vote\":{\"actor\":\"partyB\",\"bid\":{\"issuevalues\":{\"iss\":\"val2\"}},\"minPower\":2}}]}}]}}";
+	private String asJson = "{\"OptIn\":{\"votes\":[{\"Votes\":{\"actor\":\"partyA\",\"votes\":[{\"vote\":{\"actor\":\"partyA\",\"bid\":{\"issuevalues\":{\"iss\":\"val1\"}},\"minPower\":2,\"maxPower\":9}}]}},{\"Votes\":{\"actor\":\"partyB\",\"votes\":[{\"vote\":{\"actor\":\"partyB\",\"bid\":{\"issuevalues\":{\"iss\":\"val1\"}},\"minPower\":2,\"maxPower\":9}},{\"vote\":{\"actor\":\"partyB\",\"bid\":{\"issuevalues\":{\"iss\":\"val2\"}},\"minPower\":2,\"maxPower\":9}}]}}]}}";
 
 	@Override
Index: /profile/pom.xml
===================================================================
--- /profile/pom.xml	(revision 21)
+++ /profile/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>profile</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java
===================================================================
--- /profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java	(revision 21)
+++ /profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java	(revision 22)
@@ -88,4 +88,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void smokeTest() {
@@ -94,4 +95,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testTooLargeUtility() {
@@ -102,4 +104,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNegativeUtility() {
@@ -110,4 +113,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullUtility() {
@@ -118,4 +122,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = NullPointerException.class)
 	public void testNullValueUtils() {
@@ -124,4 +129,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = NullPointerException.class)
 	public void testNullIssue() {
Index: /profileconnection/pom.xml
===================================================================
--- /profileconnection/pom.xml	(revision 21)
+++ /profileconnection/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>profileconnection</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /protocol/pom.xml
===================================================================
--- /protocol/pom.xml	(revision 21)
+++ /protocol/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>protocol</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java	(revision 21)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPAC.java	(revision 22)
@@ -145,5 +145,5 @@
 			ProtocolToPartyConnFactory connectionfactory) {
 		try {
-			System.out.println("starting MOPAC");
+			//System.out.println("starting MOPAC");
 			// we're in Phase.INIT still
 			connect(connectionfactory);
@@ -314,5 +314,5 @@
 			final ProtocolToPartyConn partyconn, final Action action,
 			long now) {
-		System.out.println("received " + action);
+		//System.out.println("received " + action);
 		state = state.with(partyconn.getParty(), action, now);
 		checkEndPhase(System.currentTimeMillis());
@@ -341,4 +341,5 @@
 
 		state = state.nextPhase(now);
+
 		startPhase(now);
 	}
@@ -351,5 +352,5 @@
 	 */
 	private void broadcastNegotiators(Inform info) {
-		System.out.println("broadcasting " + info);
+		//System.out.println("broadcasting " + info);
 		for (PartyId party : state.getPhase().getPartyStates()
 				.getNegotiatingParties()) {
Index: /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java
===================================================================
--- /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java	(revision 21)
+++ /protocol/src/main/java/geniusweb/protocol/session/mopac/MOPACState.java	(revision 22)
@@ -14,4 +14,5 @@
 import geniusweb.actions.PartyId;
 import geniusweb.inform.Agreements;
+import geniusweb.inform.OptIn;
 import geniusweb.progress.Progress;
 import geniusweb.progress.ProgressRounds;
@@ -22,4 +23,5 @@
 import geniusweb.protocol.session.SessionState;
 import geniusweb.protocol.session.mopac.phase.OfferPhase;
+import geniusweb.protocol.session.mopac.phase.OptInPhase;
 import geniusweb.protocol.session.mopac.phase.Phase;
 import geniusweb.protocol.session.saop.SAOPSettings;
@@ -127,8 +129,11 @@
 	/**
 	 * @param now current time ms since 1970
-	 * @return the max possible duration in ms of this phase. Maybe negative if
-	 *         ew are past deadline
+	 * @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);
@@ -196,11 +201,18 @@
 		Phase newphase = phase.next(now,
 				Math.min(remainingNegoTime, Phase.PHASE_MAXTIME));
-		Progress newprogress = progress;
-		if (newphase instanceof OfferPhase
-				&& progress instanceof ProgressRounds)
-			newprogress = ((ProgressRounds) progress).advance();
-
-		return new MOPACState(newphase, actions, connections, newprogress,
-				getSettings(), partyprofiles);
+
+		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;
 	}
 
@@ -217,6 +229,9 @@
 	 */
 	public boolean isNewPhasePossible(long now) {
-		return phase.getPartyStates().getNegotiatingParties().size() >= 2
+		// 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;
 	}
 
Index: /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java	(revision 21)
+++ /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPSettingsTest.java	(revision 22)
@@ -97,4 +97,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void constructorNoDeadlineTest() {
Index: /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPStateTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPStateTest.java	(revision 21)
+++ /protocol/src/test/java/geniusweb/protocol/session/amop/AMOPStateTest.java	(revision 22)
@@ -172,4 +172,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test
 	public void constructWithNullConnection() {
@@ -375,11 +376,12 @@
 	@Test
 	public void testCollectVotes() {
-		Votes vote1AB = new Votes(party1,
-				Arrays.asList(new Vote(party1, a, 2), new Vote(party1, b, 2)));
-		Votes vote2AB = new Votes(party2,
-				Arrays.asList(new Vote(party2, a, 2), new Vote(party2, b, 2)));
-		Votes vote3C = new Votes(party3, Arrays.asList(new Vote(party3, c, 2)));
-		Votes vote4AC = new Votes(party4,
-				Arrays.asList(new Vote(party4, a, 2), new Vote(party4, c, 2)));
+		Votes vote1AB = new Votes(party1, Arrays
+				.asList(new Vote(party1, a, 2, 9), new Vote(party1, b, 2, 9)));
+		Votes vote2AB = new Votes(party2, Arrays
+				.asList(new Vote(party2, a, 2, 9), new Vote(party2, b, 2, 9)));
+		Votes vote3C = new Votes(party3,
+				Arrays.asList(new Vote(party3, c, 2, 9)));
+		Votes vote4AC = new Votes(party4, Arrays
+				.asList(new Vote(party4, a, 2, 9), new Vote(party4, c, 2, 9)));
 		// party 1,2,4 vote for A, party 1,2 vote for B, party 3,4 vote for C.
 		// the biggest vote is P,Q,S
@@ -407,11 +409,12 @@
 	public void testNextPhase() {
 		// copy of above. todo cleanup
-		Votes vote1AB = new Votes(party1,
-				Arrays.asList(new Vote(party1, a, 2), new Vote(party1, b, 2)));
-		Votes vote2AB = new Votes(party2,
-				Arrays.asList(new Vote(party2, a, 2), new Vote(party2, b, 2)));
-		Votes vote3C = new Votes(party3, Arrays.asList(new Vote(party3, c, 2)));
-		Votes vote4AC = new Votes(party4,
-				Arrays.asList(new Vote(party4, a, 2), new Vote(party4, c, 2)));
+		Votes vote1AB = new Votes(party1, Arrays
+				.asList(new Vote(party1, a, 2, 9), new Vote(party1, b, 2, 9)));
+		Votes vote2AB = new Votes(party2, Arrays
+				.asList(new Vote(party2, a, 2, 9), new Vote(party2, b, 2, 9)));
+		Votes vote3C = new Votes(party3,
+				Arrays.asList(new Vote(party3, c, 2, 9)));
+		Votes vote4AC = new Votes(party4, Arrays
+				.asList(new Vote(party4, a, 2, 9), new Vote(party4, c, 2, 9)));
 		// party 1,2,4 vote for A, party 1,2 vote for B, party 3,4 vote for C.
 		// the biggest vote is P,Q,S
Index: /protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java
===================================================================
--- /protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java	(revision 21)
+++ /protocol/src/test/java/geniusweb/protocol/tournament/allpermutations/AllPermutationsSettingsTest.java	(revision 22)
@@ -68,7 +68,7 @@
 		profile2 = new ProfileRef("profile2");
 		profile3 = new ProfileRef("profile3");
-		ProfileList profiles1 = new ProfileList(Arrays.asList(profile1));
-		ProfileList profiles2 = new ProfileList(Arrays.asList(profile2));
-		ProfileList profiles3 = new ProfileList(Arrays.asList(profile3));
+		profiles1 = new ProfileList(Arrays.asList(profile1));
+		profiles2 = new ProfileList(Arrays.asList(profile2));
+		profiles3 = new ProfileList(Arrays.asList(profile3));
 
 		List<ProfileList> profiles = Arrays.asList(profiles1, profiles2,
@@ -137,4 +137,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullParties() {
@@ -145,4 +146,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNoParties() {
@@ -153,4 +155,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullProfiles() {
@@ -159,4 +162,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testInsufficientProfiles() {
@@ -167,4 +171,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testNullSessionSettings() {
@@ -175,4 +180,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testOnePartyPerSession() {
@@ -189,18 +195,3 @@
 	}
 
-//	@Test
-//	public void makeCobTest() throws URISyntaxException {
-//		// Check that the cob party gets profile without the query part
-//		String profilebase = "ws://1.2.3.4:8080/profilesserver-a.b.c/websocket/get/someprofile";
-//		String partybase = "http://131.180.202.213:8080/partiesserver/run/";
-//		String query = "?a=2&partial=4";
-//		PartyWithProfile partyprofile = AllPermutationsSettings.makeCob(
-//				new PartyRef(partybase + AllPermutationsSettings.COB_PARTY),
-//				new ProfileRef(profilebase + query));
-//		assertEquals(profilebase,
-//				partyprofile.getProfile().getURI().toString());
-//		assertEquals(partybase + AllPermutationsSettings.COB_PARTY,
-//				partyprofile.getParty().getPartyRef().getURI().toString());
-//	}
-
 }
Index: /pythonadapter/pom.xml
===================================================================
--- /pythonadapter/pom.xml	(revision 21)
+++ /pythonadapter/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>pythonadapter</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /references/pom.xml
===================================================================
--- /references/pom.xml	(revision 21)
+++ /references/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>references</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /simplerunner/pom.xml
===================================================================
--- /simplerunner/pom.xml	(revision 21)
+++ /simplerunner/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>simplerunner</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /timeline/pom.xml
===================================================================
--- /timeline/pom.xml	(revision 21)
+++ /timeline/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>timeline</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /timeline/src/test/java/geniusweb/deadline/DeadlineTest.java
===================================================================
--- /timeline/src/test/java/geniusweb/deadline/DeadlineTest.java	(revision 21)
+++ /timeline/src/test/java/geniusweb/deadline/DeadlineTest.java	(revision 22)
@@ -14,7 +14,4 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 
-import geniusweb.deadline.Deadline;
-import geniusweb.deadline.DeadlineRounds;
-import geniusweb.deadline.DeadlineTime;
 import tudelft.utilities.junit.GeneralTests;
 
@@ -71,4 +68,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testIllegalArg() {
@@ -76,4 +74,5 @@
 	}
 
+	@SuppressWarnings("unused")
 	@Test(expected = IllegalArgumentException.class)
 	public void testIllegalArg2() {
Index: /voting/pom.xml
===================================================================
--- /voting/pom.xml	(revision 21)
+++ /voting/pom.xml	(revision 22)
@@ -6,5 +6,5 @@
 	<groupId>geniusweb</groupId>
 	<artifactId>voting</artifactId>
-	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.1</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.0</geniusweb.version>
+		<geniusweb.version>1.5.1</geniusweb.version>
 	</properties>
 
Index: /voting/src/main/java/geniusweb/voting/CollectedVotes.java
===================================================================
--- /voting/src/main/java/geniusweb/voting/CollectedVotes.java	(revision 21)
+++ /voting/src/main/java/geniusweb/voting/CollectedVotes.java	(revision 22)
@@ -4,8 +4,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 import geniusweb.actions.PartyId;
@@ -31,8 +29,8 @@
 	 * 
 	 * @param votesMap the {@link Votes} done for each party
-	 * @param power  the power of each party. The power is an integer number. In
-	 *               the voting process, the party powers add up to form the
-	 *               total voting power. This set may contain parties that are
-	 *               not in newmap.
+	 * @param power    the power of each party. The power is an integer number.
+	 *                 In the voting process, the party powers add up to form
+	 *                 the total voting power. This set may contain parties that
+	 *                 are not in newmap.
 	 */
 	public CollectedVotes(Map<PartyId, Votes> votesMap,
@@ -132,9 +130,7 @@
 	 * @param votes a list of all votes for a particular bid. The parties that
 	 *              placed the votes are called 'voters'
-	 * @return a subset of the voters for which holds (1) the min-power
-	 *         condition of all these voters is satisfied (2) the power of this
-	 *         subset of voters is maximal (no other satisfied set of voters
-	 *         with bigger power exists) maximum-power that placed votes with
-	 *         holding conditions.This algorithm works in quadratic time.
+	 * @return a consensusgroup with maximum power, so there is no other
+	 *         consensus group that has more power (but there may be other
+	 *         groups with same power).
 	 */
 	protected Set<PartyId> getMaxPowerGroup(Set<Vote> votes) {
@@ -142,16 +138,9 @@
 		Integer maxpower = 0;
 
-		for (Vote vote : votes) {
-			int target = vote.getMinPower();
-
-			// find parties that would join if we reach that power
-			Set<PartyId> group = votes.stream()
-					.filter(v -> target >= v.getMinPower())
-					.map(v -> v.getActor()).collect(Collectors.toSet());
-			// check what the group's power is
-			Integer groupPower = getTotalPower(group);
-			if (groupPower >= target && groupPower > maxpower) {
-				maxgroup = group;
-				maxpower = groupPower;
+		for (Set<PartyId> parties : getConsensusGroups(votes)) {
+			Integer power = getTotalPower(parties);
+			if (power > maxpower) {
+				maxgroup = parties;
+				maxpower = power;
 			}
 		}
@@ -169,5 +158,5 @@
 	 *         input size.
 	 */
-	protected Set<Set<PartyId>> getConsensusGroups(List<Vote> votes) {
+	protected Set<Set<PartyId>> getConsensusGroups(Set<Vote> votes) {
 		Set<Set<PartyId>> groups = new HashSet<>();
 
@@ -177,6 +166,7 @@
 		for (ImmutableList<Vote> voteList : allVotePermutations) {
 			Set<PartyId> parties = getParties(voteList);
-			if (parties.size() >= 2
-					&& getTotalPower(parties) >= getMinPower(voteList)) {
+			Integer totalpower = getTotalPower(parties);
+			if (parties.size() >= 2 && totalpower >= getMinPower(voteList)
+					&& totalpower <= getMaxPower(voteList)) {
 				groups.add(parties);
 			}
@@ -210,4 +200,19 @@
 		}
 		return max;
+	}
+
+	/**
+	 * 
+	 * @param votes a list of {@link Vote}s on one Bid. All parties must be
+	 *              known
+	 * @return the maximum voting power needed for this group, so that all can
+	 *         accept. This is equal to the min of the vote.getMaxPower
+	 */
+	private Integer getMaxPower(ImmutableList<Vote> votes) {
+		int min = Integer.MAX_VALUE;
+		for (Vote vote : votes) {
+			min = Math.min(min, vote.getMaxPower());
+		}
+		return min;
 	}
 
Index: /voting/src/test/java/geniusweb/voting/CollectedVotesTest.java
===================================================================
--- /voting/src/test/java/geniusweb/voting/CollectedVotesTest.java	(revision 21)
+++ /voting/src/test/java/geniusweb/voting/CollectedVotesTest.java	(revision 22)
@@ -2,4 +2,5 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 
@@ -35,13 +36,14 @@
 	private final PartyId partyQ = new PartyId("partyQ");
 	private final PartyId partyR = new PartyId("partyR");
-
-	private final Vote votePA2 = new Vote(partyP, bidA, 2);
-	private final Vote voteQA2 = new Vote(partyQ, bidA, 2);
-	private final Vote voteQB3 = new Vote(partyQ, bidB, 3);
-	private final Vote voteQB2 = new Vote(partyQ, bidB, 2);
-	private final Vote voteRA2 = new Vote(partyR, bidA, 2);
-	private final Vote voteRA3 = new Vote(partyR, bidA, 3);
-	private final Vote voteRA4 = new Vote(partyR, bidA, 4);
-	private final Vote voteRB2 = new Vote(partyR, bidB, 2);
+	private final PartyId partyS = new PartyId("partyS");
+
+	private final Vote votePA2 = new Vote(partyP, bidA, 2, 9);
+	private final Vote voteQA2 = new Vote(partyQ, bidA, 2, 9);
+	private final Vote voteQB3 = new Vote(partyQ, bidB, 3, 9);
+	private final Vote voteQB2 = new Vote(partyQ, bidB, 2, 9);
+	private final Vote voteRA2 = new Vote(partyR, bidA, 2, 9);
+	private final Vote voteRA3 = new Vote(partyR, bidA, 3, 9);
+	private final Vote voteRA4 = new Vote(partyR, bidA, 4, 9);
+	private final Vote voteRB2 = new Vote(partyR, bidB, 2, 9);
 
 	private Map<PartyId, Integer> allpowers = new HashMap<>();
@@ -73,4 +75,5 @@
 		allpowers.put(partyQ, 1);
 		allpowers.put(partyR, 1);
+		allpowers.put(partyS, 1);
 	}
 
@@ -156,6 +159,6 @@
 				allpowers);
 
-		Set<Set<PartyId>> consensus = cv
-				.getConsensusGroups(Arrays.asList(votePA2, voteQA2));
+		Set<Set<PartyId>> consensus = cv.getConsensusGroups(
+				new HashSet<>(Arrays.asList(votePA2, voteQA2)));
 		// should give 1 solution: both parties join in.
 		System.out.println(consensus);
@@ -169,6 +172,6 @@
 				allpowers);
 
-		Set<Set<PartyId>> consensus = cv
-				.getConsensusGroups(Arrays.asList(votePA2, voteQA2, voteRA4));
+		Set<Set<PartyId>> consensus = cv.getConsensusGroups(
+				new HashSet<>(Arrays.asList(votePA2, voteQA2, voteRA4)));
 		// should give 1 solution: P and Q join in. 4 is unreachable.
 		System.out.println(consensus);
@@ -182,6 +185,6 @@
 				allpowers);
 
-		Set<Set<PartyId>> consensus = cv
-				.getConsensusGroups(Arrays.asList(votePA2, voteQA2, voteRA2));
+		Set<Set<PartyId>> consensus = cv.getConsensusGroups(
+				new HashSet<>(Arrays.asList(votePA2, voteQA2, voteRA2)));
 		// should give 4 solutions: P+Q, P+R, Q+R and P+Q+R
 		System.out.println(consensus);
@@ -200,6 +203,6 @@
 				allpowers);
 
-		Set<Set<PartyId>> consensus = cv
-				.getConsensusGroups(Arrays.asList(votePA2, voteQA2, voteRA4));
+		Set<Set<PartyId>> consensus = cv.getConsensusGroups(
+				new HashSet<>(Arrays.asList(votePA2, voteQA2, voteRA4)));
 		// should give solutions P+Q and P+Q+R
 		System.out.println(consensus);
@@ -244,3 +247,54 @@
 	}
 
+	@Test
+	public void getConsensusGroupMaxPower() {
+		Vote P = new Vote(partyP, bidA, 2, 3);
+		Vote Q = new Vote(partyQ, bidA, 2, 3);
+		Vote R = new Vote(partyR, bidA, 2, 3);
+		Vote S = new Vote(partyS, bidA, 2, 3);
+		Map<PartyId, Votes> allvotes = new HashMap<>();
+		allvotes.put(partyP, new Votes(partyP, Arrays.asList(P)));
+		allvotes.put(partyQ, new Votes(partyQ, Arrays.asList(Q)));
+		allvotes.put(partyR, new Votes(partyR, Arrays.asList(R)));
+		allvotes.put(partyS, new Votes(partyS, Arrays.asList(S)));
+
+		CollectedVotes cv = new CollectedVotes(allvotes, allpowers);
+		Set<Set<PartyId>> consensus = cv.getConsensusGroups(
+				new HashSet<Vote>(Arrays.asList(P, Q, R, S)));
+		System.out.println(consensus);
+		// check that all are size 2 or 3.
+		for (Set<PartyId> set : consensus) {
+			assertTrue(set.size() == 2 || set.size() == 3);
+		}
+
+	}
+
+	@Test
+	public void getConsensusGroupMaxPowerModifiedPartyPowers() {
+		// party R gets power 2.
+		Vote P = new Vote(partyP, bidA, 2, 3);
+		Vote Q = new Vote(partyQ, bidA, 2, 3);
+		Vote R = new Vote(partyR, bidA, 2, 3);
+		Map<PartyId, Votes> allvotes = new HashMap<>();
+		allvotes.put(partyP, new Votes(partyP, Arrays.asList(P)));
+		allvotes.put(partyQ, new Votes(partyQ, Arrays.asList(Q)));
+		allvotes.put(partyR, new Votes(partyR, Arrays.asList(R)));
+
+		Map<PartyId, Integer> powers = new HashMap<PartyId, Integer>();
+		powers.put(partyP, 1);
+		powers.put(partyQ, 1);
+		powers.put(partyR, 2);
+
+		CollectedVotes cv = new CollectedVotes(allvotes, powers);
+		Set<Set<PartyId>> consensus = cv
+				.getConsensusGroups(new HashSet<Vote>(Arrays.asList(P, Q, R)));
+		System.out.println(consensus);
+		// R has power 2 now. That means groups of size 3 are not posisble.
+		// check that all are size 2.
+		for (Set<PartyId> set : consensus) {
+			assertTrue(set.size() == 2);
+		}
+
+	}
+
 }
Index: /voting/src/test/java/geniusweb/voting/votingevaluators/LargestAgreementsLoopTest.java
===================================================================
--- /voting/src/test/java/geniusweb/voting/votingevaluators/LargestAgreementsLoopTest.java	(revision 21)
+++ /voting/src/test/java/geniusweb/voting/votingevaluators/LargestAgreementsLoopTest.java	(revision 22)
@@ -74,11 +74,12 @@
 	@Test
 	public void testCollectVotes() {
-		Votes vote1AB = new Votes(party1,
-				Arrays.asList(new Vote(party1, a, 2), new Vote(party1, b, 2)));
-		Votes vote2AB = new Votes(party2,
-				Arrays.asList(new Vote(party2, a, 2), new Vote(party2, b, 2)));
-		Votes vote3C = new Votes(party3, Arrays.asList(new Vote(party3, c, 2)));
-		Votes vote4AC = new Votes(party4,
-				Arrays.asList(new Vote(party4, a, 2), new Vote(party4, c, 2)));
+		Votes vote1AB = new Votes(party1, Arrays
+				.asList(new Vote(party1, a, 2, 9), new Vote(party1, b, 2, 9)));
+		Votes vote2AB = new Votes(party2, Arrays
+				.asList(new Vote(party2, a, 2, 9), new Vote(party2, b, 2, 9)));
+		Votes vote3C = new Votes(party3,
+				Arrays.asList(new Vote(party3, c, 2, 9)));
+		Votes vote4AC = new Votes(party4, Arrays
+				.asList(new Vote(party4, a, 2, 9), new Vote(party4, c, 2, 9)));
 		// party 1,2,4 vote for A, party 1,2 vote for B, party 3,4 vote for C.
 		// the biggest vote is P,Q,S
