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
