Index: profile/src/test/java/geniusweb/profile/DefaultPartialOrderingTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/DefaultPartialOrderingTest.java	(revision 53)
+++ 	(revision )
@@ -1,116 +1,0 @@
-package geniusweb.profile;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-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 java.util.Set;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import geniusweb.issuevalue.Bid;
-import geniusweb.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.DiscreteValueSet;
-import geniusweb.issuevalue.Domain;
-import geniusweb.issuevalue.ValueSet;
-import tudelft.utilities.junit.GeneralTests;
-
-public class DefaultPartialOrderingTest
-		extends GeneralTests<DefaultPartialOrdering> {
-
-	private final String serialized = "{\"DefaultPartialOrdering\":{"
-			+ "\"name\":\"ordering1\","
-			+ "\"domain\":{\"name\":\"dom1\",\"issuesValues\":{\"iss1\":{\"values\":[\"1\",\"2\",\"3\"]}}},"
-			+ "\"better\":{\"{\\\"issuevalues\\\":{\\\"iss1\\\":\\\"1\\\"}}\":[{\"issuevalues\":{\"iss1\":\"2\"}}],\"{\\\"issuevalues\\\":{\\\"iss1\\\":\\\"3\\\"}}\":[{\"issuevalues\":{\"iss1\":\"2\"}}]},"
-			+ "\"reservationbid\":{\"issuevalues\":{\"iss1\":\"1\"}}}}";
-
-	// we need real (not mock) values otherwise serializer crashes..
-	private String issue1 = "iss1";
-	private DefaultPartialOrdering ordering1, ordering1b, ordering2, ordering3,
-			ordering4, ordering5;
-
-	private Bid bid1, bid2, bid3;
-
-	@Before
-	public void before() {
-		Map<String, ValueSet> issues = new HashMap<>();
-		DiscreteValue val1 = new DiscreteValue("1");
-		DiscreteValue val2 = new DiscreteValue("2");
-		DiscreteValue val3 = new DiscreteValue("3");
-		issues.put(issue1, new DiscreteValueSet(
-				new HashSet<>(Arrays.asList(val1, val2, val3))));
-		Domain domain1 = new Domain("dom1", issues);
-		Domain domain2 = new Domain("dom2", issues);
-		bid1 = new Bid(Collections.singletonMap(issue1, val1));
-		bid2 = new Bid(Collections.singletonMap(issue1, val2));
-		bid3 = new Bid(Collections.singletonMap(issue1, val3));
-
-		Map<Bid, Set<Bid>> map1 = new HashMap<>();
-		map1.put(bid1, new HashSet<Bid>(Arrays.asList(bid2)));
-		map1.put(bid3, new HashSet<Bid>(Arrays.asList(bid2)));
-
-		Map<Bid, Set<Bid>> map2 = new HashMap<>();
-		map2.put(bid1, new HashSet<Bid>(Arrays.asList(bid2)));
-		map2.put(bid3, new HashSet<Bid>(Arrays.asList(bid1)));
-
-		ordering1 = new DefaultPartialOrdering("ordering1", domain1, bid1,
-				map1);
-		ordering1b = new DefaultPartialOrdering("ordering1", domain1, bid1,
-				map1);
-		ordering2 = new DefaultPartialOrdering("ordering2", domain1, bid1,
-				map1);
-		ordering3 = new DefaultPartialOrdering("ordering1", domain2, bid1,
-				map1);
-		ordering4 = new DefaultPartialOrdering("ordering1", domain1, bid2,
-				map1);
-		ordering5 = new DefaultPartialOrdering("ordering1", domain1, bid1,
-				map2);
-
-	}
-
-	@Override
-	public List<List<DefaultPartialOrdering>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(ordering1, ordering1b),
-				Arrays.asList(ordering2), Arrays.asList(ordering3),
-				Arrays.asList(ordering4), Arrays.asList(ordering5));
-	}
-
-	@Override
-	public List<String> getGeneralTestStrings() {
-		return Arrays.asList("DefaultPartialOrdering.*",
-				"DefaultPartialOrdering.*", "DefaultPartialOrdering.*",
-				"DefaultPartialOrdering.*", "DefaultPartialOrdering.*");
-	}
-
-	@Test
-	public void testSerialize() throws JsonProcessingException {
-		ObjectMapper jackson = new ObjectMapper();
-		assertEquals(serialized, jackson.writeValueAsString(ordering1));
-		System.out.println(serialized);
-	}
-
-	@Test
-	public void testDeserialize() throws IOException {
-		ObjectMapper jackson = new ObjectMapper();
-		assertEquals(ordering1, jackson.readValue(serialized, Profile.class));
-	}
-
-	@Test
-	public void testIsBetter() {
-		assertTrue(ordering1.isPreferredOrEqual(bid1, bid2));
-		assertFalse(ordering1.isPreferredOrEqual(bid1, bid3));
-		assertFalse(ordering1.isPreferredOrEqual(bid2, bid3));
-	}
-
-}
Index: profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java	(revision 53)
+++ profile/src/test/java/geniusweb/profile/utilityspace/DiscreteValueSetUtilitiesTest.java	(revision 1)
@@ -1,9 +1,4 @@
 package geniusweb.profile.utilityspace;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.Arrays;
@@ -14,22 +9,13 @@
 import org.junit.Test;
 
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
 import geniusweb.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.DiscreteValueSet;
-import geniusweb.issuevalue.NumberValue;
-import geniusweb.issuevalue.NumberValueSet;
-import geniusweb.issuevalue.ValueSet;
+import geniusweb.profile.utilityspace.DiscreteValueSetUtilities;
 import tudelft.utilities.junit.GeneralTests;
 
-public class DiscreteValueSetUtilitiesTest
-		extends GeneralTests<DiscreteValueSetUtilities> {
+public class DiscreteValueSetUtilitiesTest extends GeneralTests<DiscreteValueSetUtilities> {
 
 	private final static DiscreteValue vala = new DiscreteValue("a");
 	private final static DiscreteValue vala1 = new DiscreteValue("a");
 	private final static DiscreteValue valb = new DiscreteValue("b");
-	private final static NumberValue valn = new NumberValue("99");
 
 	private final static BigDecimal util = new BigDecimal("0.14");
@@ -37,10 +23,5 @@
 	private final static BigDecimal utilb = new BigDecimal("0.37");
 
-	private final static BigDecimal badutil = new BigDecimal("1.37");
-	private final static BigDecimal badutil2 = new BigDecimal("-0.37");
-
-	private final static DiscreteValueSetUtilities utils, utils1, utilsb,
-			utils1b, utilsc1, utilsc2;
-	private static final ObjectMapper jackson = new ObjectMapper();
+	private final static DiscreteValueSetUtilities utils, utils1, utilsb, utils1b, utilsc1, utilsc2;
 
 	static {
@@ -75,6 +56,5 @@
 	@Override
 	public List<List<DiscreteValueSetUtilities>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(utils, utils1),
-				Arrays.asList(utilsb), Arrays.asList(utils1b),
+		return Arrays.asList(Arrays.asList(utils, utils1), Arrays.asList(utilsb), Arrays.asList(utils1b),
 				Arrays.asList(utilsc1, utilsc2));
 	}
@@ -82,11 +62,8 @@
 	@Override
 	public List<String> getGeneralTestStrings() {
-		return Arrays.asList("DiscreteValueSetUtilities\\{\"a\"=0.14\\}",
-				"DiscreteValueSetUtilities\\{\"b\"=0.37\\}",
-				"DiscreteValueSetUtilities\\{\"a\"=0.37\\}",
-				"DiscreteValueSetUtilities\\{\"a\"=0.14, \"b\"=0.37\\}");
+		return Arrays.asList("ValueSetUtilities\\{\"a\"=0.14\\}", "ValueSetUtilities\\{\"b\"=0.37\\}",
+				"ValueSetUtilities\\{\"a\"=0.37\\}", "ValueSetUtilities\\{\"a\"=0.14, \"b\"=0.37\\}");
 	}
 
-	@SuppressWarnings("unused")
 	@Test
 	public void smokeTest() {
@@ -95,129 +72,3 @@
 	}
 
-	@SuppressWarnings("unused")
-	@Test(expected = IllegalArgumentException.class)
-	public void testTooLargeUtility() {
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		valueUtils.put(valb, badutil);
-		new DiscreteValueSetUtilities(valueUtils);
-	}
-
-	@SuppressWarnings("unused")
-	@Test(expected = IllegalArgumentException.class)
-	public void testNegativeUtility() {
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		valueUtils.put(valb, badutil2);
-		new DiscreteValueSetUtilities(valueUtils);
-	}
-
-	@SuppressWarnings("unused")
-	@Test(expected = IllegalArgumentException.class)
-	public void testNullUtility() {
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, null);
-		valueUtils.put(valb, util);
-		new DiscreteValueSetUtilities(valueUtils);
-	}
-
-	@SuppressWarnings("unused")
-	@Test(expected = NullPointerException.class)
-	public void testNullValueUtils() {
-		new DiscreteValueSetUtilities(null);
-
-	}
-
-	@SuppressWarnings("unused")
-	@Test(expected = NullPointerException.class)
-	public void testNullIssue() {
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		valueUtils.put(null, utilb);
-		new DiscreteValueSetUtilities(valueUtils);
-	}
-
-	@Test
-	public void testGetUtility() {
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		valueUtils.put(valb, utilb);
-		DiscreteValueSetUtilities utilset = new DiscreteValueSetUtilities(
-				valueUtils);
-		assertEquals(util, utilset.getUtility(vala));
-		assertEquals(utilb, utilset.getUtility(valb));
-		assertEquals(BigDecimal.ZERO,
-				utilset.getUtility(new DiscreteValue("unknownIssue")));
-
-	}
-
-	@Test
-	public void testIsFitting() {
-		ValueSet valueset = new DiscreteValueSet(Arrays.asList(vala, valb));
-
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		DiscreteValueSetUtilities utilset = new DiscreteValueSetUtilities(
-				valueUtils);
-
-		assertEquals(
-				"The values in the set DiscreteValueSet[\"a\", \"b\"] do not match the values mapped to utilities [\"a\"]",
-				utilset.isFitting(valueset));
-
-		valueUtils.put(valb, utilb);
-		utilset = new DiscreteValueSetUtilities(valueUtils);
-		assertEquals(null, utilset.isFitting(valueset));
-
-		valueUtils.put(new DiscreteValue("unknownIssue"), util1);
-		utilset = new DiscreteValueSetUtilities(valueUtils);
-		assertEquals(
-				"The values in the set DiscreteValueSet[\"a\", \"b\"] do not match the values mapped to utilities [\"a\", \"b\", \"unknownIssue\"]",
-				utilset.isFitting(valueset));
-
-	}
-
-	@Test
-	public void testIsFittingWrongType() {
-		ValueSet valueset = new NumberValueSet(BigDecimal.ZERO, BigDecimal.ONE,
-				new BigDecimal("0.3"));
-
-		Map<DiscreteValue, BigDecimal> valueUtils = new HashMap<>();
-		valueUtils.put(vala, util);
-		valueUtils.put(valb, utilb);
-		DiscreteValueSetUtilities utilset = new DiscreteValueSetUtilities(
-				valueUtils);
-
-		assertEquals(
-				"The utilities are for a discrete valueset but the given values are numberValueSet[0,1,0.3]",
-				utilset.isFitting(valueset));
-
-	}
-
-	@Test
-	public void testIsFittingWrongIssues()
-			throws JsonParseException, JsonMappingException, IOException {
-		// Notice, party tent has extra single quote in the valuesstr.
-		String valuesstr = "{\"values\": [\"Party Tent'\",\"Your Dorm\", \"Party Room\", \"Ballroom\" ]}";
-		String utilstring = "{\"DiscreteValueSetUtilities\": {\"valueUtilities\": {\"Party Tent\": 0.52,\"Your Dorm\": 0.23,\"Party Room\": 0.99,\"Ballroom\": 0.77}}}";
-		ValueSetUtilities valueutils = jackson.readValue(utilstring,
-				ValueSetUtilities.class);
-		ValueSet values = jackson.readValue(valuesstr, ValueSet.class);
-		System.out.println(valueutils.isFitting(values));
-		assertFalse(valueutils.isFitting(values).isEmpty());
-
-	}
-
-	@Test
-	public void testDeserializeAsDiscrete()
-			throws JsonParseException, JsonMappingException, IOException {
-		// Check that DiscreteValueSetUtilities properly deserializes
-		// discreteutils.
-		String utilstring = "{\"DiscreteValueSetUtilities\": {\"valueUtilities\": {\"Party Tent\": 0.52,\"Your Dorm\": 0.23,\"Party Room\": 0.99,\"Ballroom\": 0.77}}}";
-		DiscreteValueSetUtilities valueutils = jackson.readValue(utilstring,
-				DiscreteValueSetUtilities.class);
-		assertTrue(new BigDecimal("0.23").compareTo(
-				valueutils.getUtility(new DiscreteValue("Your Dorm"))) == 0);
-
-	}
-
 }
Index: profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveSerializationTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveSerializationTest.java	(revision 53)
+++ profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveSerializationTest.java	(revision 1)
@@ -14,5 +14,5 @@
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
+import com.fasterxml.jackson.databind.exc.InvalidDefinitionException;
 
 import geniusweb.issuevalue.Bid;
@@ -20,12 +20,13 @@
 import geniusweb.issuevalue.DiscreteValueSet;
 import geniusweb.issuevalue.Domain;
-import geniusweb.issuevalue.NumberValue;
-import geniusweb.issuevalue.NumberValueSet;
 import geniusweb.issuevalue.Value;
 import geniusweb.issuevalue.ValueSet;
 import geniusweb.profile.Profile;
+import geniusweb.profile.utilityspace.DiscreteValueSetUtilities;
+import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
+import geniusweb.profile.utilityspace.NumberValueSetUtilities;
+import geniusweb.profile.utilityspace.ValueSetUtilities;
 
 public class LinearAdditiveSerializationTest {
-
 	private static final BigDecimal VAL2 = new BigDecimal("0.2");
 	private static final BigDecimal VAL3 = new BigDecimal("0.3");
@@ -38,6 +39,6 @@
 	private DiscreteValue i1v1 = new DiscreteValue("issue1value1");
 	private DiscreteValue i1v2 = new DiscreteValue("issue1value2");
-	private NumberValue i2v1 = new NumberValue("15");
-	private NumberValue i2v2 = new NumberValue("16");
+	private DiscreteValue i2v1 = new DiscreteValue("issue2value1");
+	private DiscreteValue i2v2 = new DiscreteValue("issue2value2");
 	private Domain domain;
 
@@ -46,17 +47,24 @@
 	private BigDecimal TWELVE = new BigDecimal("12");
 	private BigDecimal EIGHTEEN = new BigDecimal("18");
-	private static final ObjectMapper jackson = new ObjectMapper();
 
 	private LinearAdditiveUtilitySpace space;
-
-	private String serialized = "{\"LinearAdditiveUtilitySpace\":{\"domain\":{\"name\":\"test\",\"issuesValues\":{\"issue2\":{\"range\":{\"low\":12,\"high\":18,\"step\":1}},\"issue1\":{\"values\":[\"issue1value1\",\"issue1value2\"]}}},\"name\":\"testprofile\",\"issueUtilities\":{\"issue2\":{\"NumberValueSetUtilities\":{\"lowValue\":12,\"lowUtility\":0.3,\"highValue\":18,\"highUtility\":0.6}},\"issue1\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"issue1value1\":0.2,\"issue1value2\":0.3}}}},\"issueWeights\":{\"issue2\":0.4,\"issue1\":0.6},\"reservationBid\":{\"issuevalues\":{\"issue2\":15,\"issue1\":\"issue1value2\"}}}}";
+	private String serialized = "{\"LinearAdditiveUtilitySpace\":{"
+			+ "\"domain\":{\"name\":\"test\","
+			+ "\"issuesValues\":{\"issue2\":{\"values\":[\"issue2value1\",\"issue2value2\"]},"
+			+ "\"issue1\":{\"values\":[\"issue1value1\",\"issue1value2\"]}}},"
+			+ "\"name\":\"testprofile\"," + "\"issueUtilities\":"
+			+ "{\"issue2\":{\"numberutils\":{\"lowValue\":12,\"lowUtility\":0.3,\"highValue\":18,\"highUtility\":0.6}},"
+			+ "\"issue1\":{\"discreteutils\":{\"valueUtilities\":{\"issue1value1\":0.2,\"issue1value2\":0.3}}}},"
+			+ "\"issueWeights\":{\"issue2\":0.4,\"issue1\":0.6},"
+			+ "\"reservationBid\":{\"issuevalues\":{\"issue2\":\"issue2value1\",\"issue1\":\"issue1value2\"}}"
+			+ "}" + "}";
 
 	private String jobsjson = "{\"LinearAdditiveUtilitySpace\":{\"issueUtilities\":{"
-			+ "\"lease car\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
-			+ "\"permanent contract\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
-			+ "\"career development opportunities\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"high\":1,\"low\":0,\"medium\":0.5}}},"
-			+ "\"fte\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"1.0\":0.75,\"0.6\":0.25,\"0.8\":0.5}}},"
-			+ "\"salary\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"4000\":1.0,\"2500\":0.25,\"3500\":0.75,\"2000\":0,\"3000\":0.3}}},"
-			+ "\"work from home\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"1\":0.5,\"2\":0.666666666666,\"0\":0.333333333}}}},"
+			+ "\"lease car\":{\"discreteutils\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
+			+ "\"permanent contract\":{\"discreteutils\":{\"valueUtilities\":{\"no\":0,\"yes\":1}}},"
+			+ "\"career development opportunities\":{\"discreteutils\":{\"valueUtilities\":{\"high\":1,\"low\":0,\"medium\":0.5}}},"
+			+ "\"fte\":{\"discreteutils\":{\"valueUtilities\":{\"1.0\":0.75,\"0.6\":0.25,\"0.8\":0.5}}},"
+			+ "\"salary\":{\"discreteutils\":{\"valueUtilities\":{\"4000\":1.0,\"2500\":0.25,\"3500\":0.75,\"2000\":0,\"3000\":0.3}}},"
+			+ "\"work from home\":{\"discreteutils\":{\"valueUtilities\":{\"1\":0.5,\"2\":0.666666666666,\"0\":0.333333333}}}},"
 			+ "\"issueWeights\":{\"lease car\":0.06,\"permanent contract\":0.16,"
 			+ "\"career development opportunities\":0.04,\"fte\":0.32,\"salary\":0.24,\"work from home\":0.18},"
@@ -71,6 +79,6 @@
 			+ "\"issue3\":{\"values\":[\"issue1value1\",\"issue1value2\"]}}},"
 			+ "\"name\":\"testprofile\"," + "\"issueUtilities\":"
-			+ "{\"issue2\":{\"NumberValueSetUtilities\":{\"lowValue\":12,\"lowUtility\":0.3,\"highValue\":18,\"highUtility\":0.6}},"
-			+ "\"issue1\":{\"DiscreteValueSetUtilities\":{\"valueUtilities\":{\"issue1value1\":0.2,\"issue1value2\":0.3}}}},"
+			+ "{\"issue2\":{\"numberutils\":{\"lowValue\":12,\"lowUtility\":0.3,\"highValue\":18,\"highUtility\":0.6}},"
+			+ "\"issue1\":{\"discreteutils\":{\"valueUtilities\":{\"issue1value1\":0.2,\"issue1value2\":0.3}}}},"
 			+ "\"issueWeights\":{\"issue2\":0.4,\"issue1\":0.6},"
 			+ "\"reservationBid\":{\"issuevalues\":{\"issue2\":\"issue2value1\",\"issue1\":\"issue1value2\"}}"
@@ -88,5 +96,5 @@
 		Map<String, ValueSet> values = new HashMap<>();
 		values.put(ISS1, new DiscreteValueSet(Arrays.asList(i1v1, i1v2)));
-		values.put(ISS2, new NumberValueSet(TWELVE, EIGHTEEN, BigDecimal.ONE));
+		values.put(ISS2, new DiscreteValueSet(Arrays.asList(i2v1, i2v2)));
 		domain = new Domain("test", values);
 
@@ -107,4 +115,5 @@
 	@Test
 	public void testSerialize() throws JsonProcessingException {
+		ObjectMapper jackson = new ObjectMapper();
 		String string = jackson.writeValueAsString(space);
 		System.out.println(string);
@@ -114,9 +123,11 @@
 	@Test
 	public void testDeserialize() throws IOException {
+		ObjectMapper jackson = new ObjectMapper();
 		assertEquals(space, jackson.readValue(serialized, Profile.class));
 	}
 
-	@Test(expected = ValueInstantiationException.class)
+	@Test(expected = InvalidDefinitionException.class)
 	public void testDeserializeWrongIssues() throws IOException {
+		ObjectMapper jackson = new ObjectMapper();
 		jackson.readValue(serializedWrongIssues, Profile.class);
 	}
@@ -124,4 +135,5 @@
 	@Test
 	public void testDeserializeFromValue() throws IOException {
+		ObjectMapper jackson = new ObjectMapper();
 		assertEquals(space, jackson.readValue(serialized, Profile.class));
 	}
@@ -129,4 +141,5 @@
 	@Test
 	public void testDeserializeJobs() throws IOException {
+		ObjectMapper jackson = new ObjectMapper();
 		Profile jobs = jackson.readValue(jobsjson, Profile.class);
 	}
Index: profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveTest.java	(revision 53)
+++ profile/src/test/java/geniusweb/profile/utilityspace/LinearAdditiveTest.java	(revision 1)
@@ -2,16 +2,10 @@
 
 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.io.IOException;
 import java.math.BigDecimal;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -21,14 +15,13 @@
 import org.junit.Test;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.exc.ValueInstantiationException;
-
 import geniusweb.issuevalue.Bid;
 import geniusweb.issuevalue.DiscreteValue;
 import geniusweb.issuevalue.DiscreteValueSet;
 import geniusweb.issuevalue.Domain;
-import geniusweb.issuevalue.NumberValue;
 import geniusweb.issuevalue.Value;
 import geniusweb.issuevalue.ValueSet;
+import geniusweb.profile.utilityspace.DiscreteValueSetUtilities;
+import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
+import geniusweb.profile.utilityspace.ValueSetUtilities;
 import tudelft.utilities.junit.GeneralTests;
 
@@ -61,5 +54,4 @@
 
 	private static final ValueSetUtilities value1Utils;
-	private static final ObjectMapper jackson = new ObjectMapper();
 
 	static {
@@ -148,8 +140,8 @@
 	public List<String> getGeneralTestStrings() {
 		return Arrays.asList(
-				"LinearAdditive\\[\\{issue2=DiscreteValueSetUtilities\\{\"issue2value2\"=0.8, \"issue2value1\"=0.6\\}, issue1=DiscreteValueSetUtilities\\{\"issue1value1\"=0.3, \"issue1value2\"=0.2\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
-				"LinearAdditive\\[\\{issue2=DiscreteValueSetUtilities\\{\"issue2value2\"=0.8, \"issue2value1\"=0.6\\}, issue1=DiscreteValueSetUtilities\\{\"issue1value1\"=0.3, \"issue1value2\"=0.2\\}\\},\\{issue2=0.7, issue1=0.3\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
-				"LinearAdditive\\[\\{issue2=DiscreteValueSetUtilities\\{\"issue2value2\"=0.2, \"issue2value1\"=0.3\\}, issue1=DiscreteValueSetUtilities\\{\"issue1value1\"=0.6, \"issue1value2\"=0.8\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
-				"LinearAdditive\\[\\{issue2=DiscreteValueSetUtilities\\{\"issue2value2\"=0.2, \"issue2value1\"=0.3\\}, issue1=DiscreteValueSetUtilities\\{\"issue1value1\"=0.6, \"issue1value2\"=0.8\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value1\"\\}\\]");
+				"LinearAdditive\\[\\{issue2=ValueSetUtilities\\{\"issue2value2\"=0.8, \"issue2value1\"=0.6\\}, issue1=ValueSetUtilities\\{\"issue1value1\"=0.3, \"issue1value2\"=0.2\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
+				"LinearAdditive\\[\\{issue2=ValueSetUtilities\\{\"issue2value2\"=0.8, \"issue2value1\"=0.6\\}, issue1=ValueSetUtilities\\{\"issue1value1\"=0.3, \"issue1value2\"=0.2\\}\\},\\{issue2=0.7, issue1=0.3\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
+				"LinearAdditive\\[\\{issue2=ValueSetUtilities\\{\"issue2value2\"=0.2, \"issue2value1\"=0.3\\}, issue1=ValueSetUtilities\\{\"issue1value1\"=0.6, \"issue1value2\"=0.8\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value2\"\\}\\]",
+				"LinearAdditive\\[\\{issue2=ValueSetUtilities\\{\"issue2value2\"=0.2, \"issue2value1\"=0.3\\}, issue1=ValueSetUtilities\\{\"issue1value1\"=0.6, \"issue1value2\"=0.8\\}\\},\\{issue2=0.6, issue1=0.4\\},Bid\\{issue2=\"issue2value1\", issue1=\"issue1value1\"\\}\\]");
 	}
 
@@ -175,4 +167,7 @@
 	}
 
+	/**
+	 * Empty profile is not allowed since the weights then don't sum up to 1
+	 */
 	@Test
 	public void constructorOneIssueTest() {
@@ -182,5 +177,5 @@
 		weightset.put(ISS1, BigDecimal.ONE);
 		new LinearAdditiveUtilitySpace(smalldomain, NAME, utilset, weightset,
-				null);
+				reservationBid);
 	}
 
@@ -209,5 +204,5 @@
 		weightset.put(ISS1, BigDecimal.ONE);
 		LinearAdditiveUtilitySpace space = new LinearAdditiveUtilitySpace(
-				smalldomain, NAME, utilset, weightset, null);
+				smalldomain, NAME, utilset, weightset, reservationBid);
 	}
 
@@ -251,13 +246,11 @@
 		Bid bid1 = new Bid(issuevalues);
 		Map<String, Value> issuevalues1 = new HashMap<>();
-		issuevalues1.put(ISS1, i1v2);
-		issuevalues1.put(ISS2, i2v1);
+		issuevalues.put(ISS1, i1v2);
+		issuevalues.put(ISS2, i1v1);
 		Bid bid2 = new Bid(issuevalues1);
 		assertTrue(utilspace1.isPreferredOrEqual(bid1, bid2));
 		assertTrue(utilspace1.isPreferredOrEqual(bid1, bid1));
 		assertTrue(utilspace1.isPreferredOrEqual(bid2, bid2));
-		assertFalse(utilspace1.isPreferredOrEqual(bid2, bid1));
-		assertFalse(utilspace1
-				.isPreferredOrEqual(new Bid(Collections.emptyMap()), bid1));
+		assertTrue(!utilspace1.isPreferredOrEqual(bid2, bid1));
 	}
 
@@ -272,56 +265,3 @@
 				WEIGHT1.multiply(I1V1UTIL).compareTo(space.getUtility(bid)));
 	}
-
-	@Test
-	public void loadFullWithJson() throws IOException {
-		String profile = new String(
-				Files.readAllBytes(Paths.get("src/test/resources/party1.json")),
-				StandardCharsets.UTF_8);
-		UtilitySpace space = jackson.readValue(profile, UtilitySpace.class);
-
-	}
-
-	@Test
-	public void loadFullWithJsonNumber() throws IOException {
-		String profile = new String(
-				Files.readAllBytes(
-						Paths.get("src/test/resources/japantrip1.json")),
-				StandardCharsets.UTF_8);
-		UtilitySpace space = jackson.readValue(profile, UtilitySpace.class);
-
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testResBidWithNonsenseIssue() {
-		Bid resBid = new Bid("nonsense", i1v1);
-		new LinearAdditiveUtilitySpace(domain, NAME, utils, weights, resBid);
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testResBidWithWrongValueType() {
-		Bid resBid = new Bid(ISS1, new NumberValue(BigDecimal.ZERO));
-		new LinearAdditiveUtilitySpace(domain, NAME, utils, weights, resBid);
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testResBidWithNonsenseValue() {
-		Bid resBid = new Bid(ISS1, new DiscreteValue("nonsense"));
-		new LinearAdditiveUtilitySpace(domain, NAME, utils, weights, resBid);
-	}
-
-	/**
-	 * This should throw because computersell-domainmismatch has a mismatch: it
-	 * has "high 32G" as graphics option, but the utilities have no value for
-	 * that. Instead it talks about "high 24G"
-	 */
-	@Test(expected = ValueInstantiationException.class)
-	public void testIsFitting() throws IOException {
-		String profile = new String(
-				Files.readAllBytes(Paths.get(
-						"src/test/resources/computersell-domainmismatch.json")),
-				StandardCharsets.UTF_8);
-		UtilitySpace space = jackson.readValue(profile, UtilitySpace.class);
-
-	}
-
 }
Index: profile/src/test/java/geniusweb/profile/utilityspace/NumberValueSetUtilTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/NumberValueSetUtilTest.java	(revision 53)
+++ profile/src/test/java/geniusweb/profile/utilityspace/NumberValueSetUtilTest.java	(revision 1)
@@ -3,5 +3,4 @@
 import static org.junit.Assert.assertEquals;
 
-import java.io.IOException;
 import java.math.BigDecimal;
 import java.util.Arrays;
@@ -10,19 +9,9 @@
 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.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.DiscreteValueSet;
 import geniusweb.issuevalue.NumberValue;
-import geniusweb.issuevalue.NumberValueSet;
-import geniusweb.issuevalue.ValueSet;
-import tudelft.utilities.immutablelist.Range;
+import geniusweb.profile.utilityspace.NumberValueSetUtilities;
 import tudelft.utilities.junit.GeneralTests;
 
-public class NumberValueSetUtilTest
-		extends GeneralTests<NumberValueSetUtilities> {
+public class NumberValueSetUtilTest extends GeneralTests<NumberValueSetUtilities> {
 
 	private static final BigDecimal lowval1 = new BigDecimal("12.5");
@@ -32,28 +21,22 @@
 	private static final BigDecimal highvalb = new BigDecimal("18.4");
 	private static final BigDecimal highutil = new BigDecimal("0.9");
-	private static final NumberValueSetUtilities valueset1 = new NumberValueSetUtilities(
-			lowval1, low1util, highval, highutil);
-	private static final NumberValueSetUtilities valueset1b = new NumberValueSetUtilities(
-			lowval1, low1util, highval, highutil);
-	private static final NumberValueSetUtilities valueset2 = new NumberValueSetUtilities(
-			lowval1, low1utilb, highval, highutil);
-	private static final NumberValueSetUtilities valueset3 = new NumberValueSetUtilities(
-			lowval1, low1util, highvalb, highutil);
-	private static final BigDecimal ZERO_1 = new BigDecimal("0.1");
-	private final String utilstring = "{\"NumberValueSetUtilities\":{\"lowValue\":12.5,\"lowUtility\":0.5,\"highValue\":18.5,\"highUtility\":0.9}}";
-
-	private static final ObjectMapper jackson = new ObjectMapper();
+	private static final NumberValueSetUtilities valueset1 = new NumberValueSetUtilities(lowval1, low1util, highval,
+			highutil);
+	private static final NumberValueSetUtilities valueset1b = new NumberValueSetUtilities(lowval1, low1util, highval,
+			highutil);
+	private static final NumberValueSetUtilities valueset2 = new NumberValueSetUtilities(lowval1, low1utilb, highval,
+			highutil);
+	private static final NumberValueSetUtilities valueset3 = new NumberValueSetUtilities(lowval1, low1util, highvalb,
+			highutil);
 
 	@Override
 	public List<List<NumberValueSetUtilities>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(valueset1, valueset1b),
-				Arrays.asList(valueset2), Arrays.asList(valueset3));
+		return Arrays.asList(Arrays.asList(valueset1, valueset1b), Arrays.asList(valueset2), Arrays.asList(valueset3));
 	}
 
 	@Override
 	public List<String> getGeneralTestStrings() {
-		return Arrays.asList("NumberValueSetUtilities\\(12.5->0.5,18.5->0.9\\)",
-				"NumberValueSetUtilities\\(12.5->0.6,18.5->0.9\\)",
-				"NumberValueSetUtilities\\(12.5->0.5,18.4->0.9\\)");
+		return Arrays.asList("NumberValUtility\\(12.5->0.5,18.5->0.9\\)", "NumberValUtility\\(12.5->0.6,18.5->0.9\\)",
+				"NumberValUtility\\(12.5->0.5,18.4->0.9\\)");
 	}
 
@@ -66,135 +49,16 @@
 	public void utilAscentingTest() {
 		NumberValueSetUtilities utils = valueset1;
-		assertEquals(0,
-				low1util.compareTo(utils.getUtility(new NumberValue(lowval1))));
+		assertEquals(0, low1util.compareTo(utils.getUtility(new NumberValue(lowval1))));
 	}
 
 	@Test
 	public void utilDescendingTest() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				highutil, highval, low1util);
-		assertEquals(0,
-				highutil.compareTo(utils.getUtility(new NumberValue(lowval1))));
+		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1, highutil, highval, low1util);
+		assertEquals(0, highutil.compareTo(utils.getUtility(new NumberValue(lowval1))));
 	}
 
 	@Test(expected = IllegalArgumentException.class)
 	public void reverserangetest() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(highval,
-				low1util, highval, highutil);
-	}
-
-	@Test(expected = NullPointerException.class)
-	public void testNullHigh() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				low1util, null, highutil);
-	}
-
-	@Test(expected = NullPointerException.class)
-	public void testNullHighUtil() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				low1util, highval, null);
-	}
-
-	@Test(expected = NullPointerException.class)
-	public void testNullLow() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(null,
-				low1util, highval, highutil);
-	}
-
-	@Test(expected = NullPointerException.class)
-	public void testNullLowUtil() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				null, highval, highutil);
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testLowUtilNegative() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				new BigDecimal("-0.2"), highval, highutil);
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testHighUtilNegative() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				low1util, highval, new BigDecimal("-0.000003"));
-	}
-
-	@Test
-	public void getUtilTest() {
-		NumberValueSetUtilities utils = new NumberValueSetUtilities(lowval1,
-				low1util, highval, highutil);
-		assertEquals(0,
-				highutil.compareTo(utils.getUtility(new NumberValue(highval))));
-		assertEquals(0,
-				low1util.compareTo(utils.getUtility(new NumberValue(lowval1))));
-		// linear interpolated , check center
-		BigDecimal middleutil = low1util.add(highutil)
-				.divide(new BigDecimal("2"));
-		NumberValue middleval = new NumberValue(
-				lowval1.add(highval).divide(new BigDecimal("2")));
-		assertEquals(0, middleutil.compareTo(utils.getUtility(middleval)));
-
-	}
-
-	@Test
-	public void testIsNotFittingRange() {
-		ValueSet valueset = new NumberValueSet(
-				new Range(low1util, highutil, new BigDecimal("0.02")));
-		ValueSetUtilities utilset = new NumberValueSetUtilities(lowval1,
-				low1util, highval, highutil);
-		assertEquals(
-				"the utilities are specified down to 12.5 but the valueset starts at 0.5",
-				utilset.isFitting(valueset));
-	}
-
-	@Test
-	public void testTopOfRangeTooLarge() {
-		ValueSet valueset = new NumberValueSet(
-				new Range(lowval1, highval.subtract(ZERO_1), ZERO_1));
-		ValueSetUtilities utilset = new NumberValueSetUtilities(lowval1,
-				low1util, highval, highutil);
-		assertEquals(
-				"the utilities are specified up to 18.5 but the valueset ends at 18.4",
-				utilset.isFitting(valueset));
-	}
-
-	@Test
-	public void testIsFitting() {
-		ValueSet valueset = new NumberValueSet(
-				new Range(lowval1, highval, BigDecimal.ONE));
-		ValueSetUtilities utilset = new NumberValueSetUtilities(lowval1,
-				low1util, highval, highutil);
-		assertEquals(null, utilset.isFitting(valueset));
-	}
-
-	@Test
-	public void testIsFittingWrongType() {
-		DiscreteValue vala = new DiscreteValue("a");
-		DiscreteValue valb = new DiscreteValue("b");
-		ValueSet valueset = new DiscreteValueSet(Arrays.asList(vala, valb));
-
-		NumberValueSetUtilities utilset = new NumberValueSetUtilities(lowval1,
-				low1util, highval, highutil);
-		assertEquals(
-				"The utilities are for a number valueset but the given values are DiscreteValueSet[\"a\", \"b\"]",
-				utilset.isFitting(valueset));
-
-	}
-
-	@Test
-	public void testSerialize() throws JsonProcessingException {
-
-		String json = jackson.writeValueAsString(valueset1);
-		System.out.println(json);
-		assertEquals(utilstring, json);
-	}
-
-	@Test
-	public void testDeserialize()
-			throws JsonParseException, JsonMappingException, IOException {
-		ValueSetUtilities valueutils = jackson.readValue(utilstring,
-				ValueSetUtilities.class);
-		assertEquals(valueset1, valueutils);
-
+		NumberValueSetUtilities utils = new NumberValueSetUtilities(highval, highutil, lowval1, low1util);
 	}
 
Index: profile/src/test/java/geniusweb/profile/utilityspace/PartsUtilitiesTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/PartsUtilitiesTest.java	(revision 53)
+++ 	(revision )
@@ -1,144 +1,0 @@
-package geniusweb.profile.utilityspace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-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.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import geniusweb.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.Value;
-import tudelft.utilities.junit.GeneralTests;
-
-public class PartsUtilitiesTest extends GeneralTests<PartsUtilities> {
-	private static final String iss2 = "issue2";
-
-	private static final String iss1 = "issue1";
-
-	private final ObjectMapper jackson = new ObjectMapper();
-
-	private static BigDecimal N01 = new BigDecimal("0.1"),
-			N02 = new BigDecimal("0.2"), N03 = new BigDecimal("0.3"),
-			N05 = new BigDecimal("0.5"), N07 = new BigDecimal("0.7"),
-			N08 = new BigDecimal("0.8"), N09 = new BigDecimal("0.9");
-	private final static DiscreteValue low = new DiscreteValue("low");
-	private final static DiscreteValue high = new DiscreteValue("high");
-
-	private final static String jsontext = "{\"PartsUtilities\":{\"issues\":[\"issue1\",\"issue2\"],\"utilslist\":[{\"values\":[\"low\",\"low\"],\"util\":0.3},{\"values\":[\"high\",\"high\"],\"util\":0.9}]}}";
-
-	private PartsUtilities parts1, parts1a, parts2, parts3;
-
-	@Before
-	public void before() {
-		List<PartUtil> vals = new LinkedList<>();
-		vals.add(new PartUtil(Arrays.asList(low, low), N03));
-		vals.add(new PartUtil(Arrays.asList(high, high), N09));
-		List<PartUtil> vals1 = new LinkedList<>();
-		vals1.add(new PartUtil(Arrays.asList(low, low), N09));
-		List<String> issues = Arrays.asList(iss1, iss2);
-		parts1 = new PartsUtilities(issues, vals);
-		parts1a = new PartsUtilities(issues, vals);
-		parts2 = new PartsUtilities(Arrays.asList(iss1), vals);
-		parts3 = new PartsUtilities(issues, vals1);
-	}
-
-	@Override
-	public List<List<PartsUtilities>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(parts1, parts1a),
-				Arrays.asList(parts2), Arrays.asList(parts3));
-	}
-
-	@Override
-	public List<String> getGeneralTestStrings() {
-		return Arrays.asList(
-				"PartsUtilities..issue1, issue2.,\\{.\"low\", \"low\".=0.3, .\"high\", \"high\".=0.9\\}.",
-				"PartsUtilities..issue1.,\\{.\"low\", \"low\".=0.3, .\"high\", \"high\".=0.9\\}.",
-				"PartsUtilities..issue1, issue2.,\\{.\"low\", \"low\".=0.9\\}.");
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testWeightsTooHigh() {
-		Map<ProductOfValue, BigDecimal> utils = new HashMap<>();
-		utils.put(new ProductOfValue(Arrays.asList(low, low)),
-				new BigDecimal("1.1"));
-		new PartsUtilities(Arrays.asList(iss1, iss2), utils);
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void testWeightsTooLow() {
-		Map<ProductOfValue, BigDecimal> utils = new HashMap<>();
-		utils.put(new ProductOfValue(Arrays.asList(low, low)),
-				new BigDecimal("-0.3"));
-		new PartsUtilities(Arrays.asList(iss1, iss2), utils);
-	}
-
-	@Test
-	public void testBasicSerialize()
-			throws JsonParseException, JsonMappingException, IOException {
-		System.out.println(jsontext);
-		assertEquals(jsontext, jackson.writeValueAsString(parts1));
-	}
-
-	@Test
-	public void testBasicDeserialize()
-			throws JsonParseException, JsonMappingException, IOException {
-		System.out.println(jsontext);
-		assertEquals(parts1, jackson.readValue(jsontext, PartsUtilities.class));
-	}
-
-	@Test
-	public void testGetUtility() {
-		assertEquals(N03,
-				parts1.getUtility(new ProductOfValue(Arrays.asList(low, low))));
-		assertEquals(N09, parts1
-				.getUtility(new ProductOfValue(Arrays.asList(high, high))));
-		assertEquals(BigDecimal.ZERO, parts1
-				.getUtility(new ProductOfValue(Arrays.asList(low, high))));
-	}
-
-	@Test
-	public void testGetIssues() {
-		assertEquals(Arrays.asList(iss1, iss2), parts1.getIssues());
-	}
-
-	@Test
-	public void testGetIncorrectValue() {
-		assertEquals(BigDecimal.ZERO, parts1.getUtility(low));
-	}
-
-	@Test
-	public void testGetValue() {
-		assertTrue(N03.compareTo(parts1
-				.getUtility(new ProductOfValue(Arrays.asList(low, low)))) == 0);
-	}
-
-	@Test
-	public void testMerge() {
-		Map<ProductOfValue, BigDecimal> extravals = new HashMap<>();
-		extravals.put(new ProductOfValue(Arrays.asList(low, low)),
-				N01.multiply(N05));
-		extravals.put(new ProductOfValue(Arrays.asList(high, high)),
-				N01.multiply(N07));
-		PartsUtilities extraparts = new PartsUtilities(
-				Arrays.asList("extra1", "extra2"), extravals);
-
-		PartsUtilities merged = parts1.add(extraparts);
-
-		Value pval = new ProductOfValue(Arrays.asList(low, low, high, high));
-		assertEquals(0,
-				N03.add(N01.multiply(N07)).compareTo(merged.getUtility(pval)));
-	}
-
-}
Index: profile/src/test/java/geniusweb/profile/utilityspace/ProductOfValueTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/ProductOfValueTest.java	(revision 53)
+++ 	(revision )
@@ -1,78 +1,0 @@
-package geniusweb.profile.utilityspace;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
-
-import org.junit.Test;
-
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import geniusweb.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.Value;
-import tudelft.utilities.junit.GeneralTests;
-
-public class ProductOfValueTest extends GeneralTests<ProductOfValue> {
-	private final static ObjectMapper jackson = new ObjectMapper();
-
-	private final static Value value1 = new DiscreteValue("val1");
-	private final static Value value2 = new DiscreteValue("val2");
-	private final static ProductOfValue values1 = new ProductOfValue(
-			Arrays.asList(value1, value2));
-	private final static ProductOfValue values1a = new ProductOfValue(
-			Arrays.asList(value1, value2));
-	private final static ProductOfValue values2 = new ProductOfValue(
-			Arrays.asList(value2));
-	private final static DiscreteValue low = new DiscreteValue("low");
-	private final static DiscreteValue high = new DiscreteValue("high");
-
-	private String jsontext = "[\"val1\",\"val2\"]";
-
-	@Override
-	public List<List<ProductOfValue>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(values1, values1a),
-				Arrays.asList(values2));
-	}
-
-	@Override
-	public List<String> getGeneralTestStrings() {
-		return Arrays.asList(".*\"val1\", \"val2\".*", ".*\"val2\".*");
-	}
-
-	@Test
-	public void testSerialize()
-			throws JsonParseException, JsonMappingException, IOException {
-
-		assertEquals(jsontext, jackson.writeValueAsString(values1));
-	}
-
-	@Test
-	public void testBasicDeserialize()
-			throws JsonParseException, JsonMappingException, IOException {
-		System.out.println(jsontext);
-		assertEquals(values1,
-				jackson.readValue(jsontext, ProductOfValue.class));
-	}
-
-	@Test
-	public void testMerge() {
-		Value val1 = mock(Value.class);
-		Value val2 = mock(Value.class);
-		Value val3 = mock(Value.class);
-		Value val4 = mock(Value.class);
-
-		ProductOfValue prodOfVal1 = new ProductOfValue(
-				Arrays.asList(val1, val2));
-		ProductOfValue prodOfVal2 = new ProductOfValue(
-				Arrays.asList(val3, val4));
-
-		ProductOfValue prodVal = prodOfVal1.merge(prodOfVal2);
-		assertEquals(4, prodVal.getValues().size());
-	}
-
-}
Index: profile/src/test/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpaceTest.java
===================================================================
--- profile/src/test/java/geniusweb/profile/utilityspace/SumOfGroupsUtilitySpaceTest.java	(revision 53)
+++ 	(revision )
@@ -1,397 +1,0 @@
-package geniusweb.profile.utilityspace;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-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 com.fasterxml.jackson.databind.exc.ValueInstantiationException;
-
-import geniusweb.issuevalue.Bid;
-import geniusweb.issuevalue.DiscreteValue;
-import geniusweb.issuevalue.DiscreteValueSet;
-import geniusweb.issuevalue.Domain;
-import geniusweb.issuevalue.Value;
-import geniusweb.issuevalue.ValueSet;
-import geniusweb.profile.Profile;
-import tudelft.utilities.immutablelist.AbstractImmutableList;
-import tudelft.utilities.immutablelist.ImmutableList;
-import tudelft.utilities.immutablelist.Outer;
-import tudelft.utilities.junit.GeneralTests;
-
-public class SumOfGroupsUtilitySpaceTest
-		extends GeneralTests<SumOfGroupsUtilitySpace> {
-	private final ObjectMapper jackson = new ObjectMapper();
-	private SumOfGroupsUtilitySpace pa1;
-	private final String iss1 = "issue1", iss2 = "issue2", iss3 = "issue3";
-	private static BigDecimal N01 = new BigDecimal("0.1"),
-			N02 = new BigDecimal("0.2"), N03 = new BigDecimal("0.3"),
-			N05 = new BigDecimal("0.5"), N07 = new BigDecimal("0.7"),
-			N08 = new BigDecimal("0.8"), N09 = new BigDecimal("0.9");
-
-	private final DiscreteValue lo = new DiscreteValue("low");
-	private final DiscreteValue hi = new DiscreteValue("high");
-	private final Bid resBid = new Bid(iss1, hi);
-
-	private Domain domain;
-	private PartsUtilities putils12, putils3, putils3b;
-	private String serialized = "{\"SumOfGroupsUtilitySpace\":{\"domain\":{\"name\":\"domain\",\"issuesValues\":{\"issue3\":{\"values\":[\"low\",\"high\"]},\"issue2\":{\"values\":[\"low\",\"high\"]},\"issue1\":{\"values\":[\"low\",\"high\"]}}},\"name\":\"testspace\",\"partUtilities\":{\"1and2\":{\"PartsUtilities\":{\"issues\":[\"issue1\",\"issue2\"],\"utilslist\":[{\"values\":[\"low\",\"low\"],\"util\":0.16},{\"values\":[\"high\",\"high\"],\"util\":0.72},{\"values\":[\"low\",\"high\"],\"util\":0.16},{\"values\":[\"high\",\"low\"],\"util\":0.16}]}},\"3\":{\"PartsUtilities\":{\"issues\":[\"issue3\"],\"utilslist\":[{\"values\":[\"low\"],\"util\":0.16},{\"values\":[\"high\"],\"util\":0.14}]}}},\"reservationbid\":{\"issuevalues\":{\"issue1\":\"high\"}}}}";
-	private SumOfGroupsUtilitySpace sog1, sog1a, sog2, sog3;
-
-	@Before
-	public void before() {
-		Map<String, ValueSet> issues = new HashMap<>();
-		issues.put(iss1, new DiscreteValueSet(lo, hi));
-		issues.put(iss2, new DiscreteValueSet(lo, hi));
-		issues.put(iss3, new DiscreteValueSet(lo, hi));
-		domain = new Domain("domain", issues);
-
-		Map<ProductOfValue, BigDecimal> utils12 = new HashMap<>();
-		// util12 has weight N08
-		utils12.put(new ProductOfValue(Arrays.asList(lo, lo)),
-				N02.multiply(N08));
-		utils12.put(new ProductOfValue(Arrays.asList(lo, hi)),
-				N02.multiply(N08));
-		utils12.put(new ProductOfValue(Arrays.asList(hi, lo)),
-				N02.multiply(N08));
-		utils12.put(new ProductOfValue(Arrays.asList(hi, hi)),
-				N09.multiply(N08));
-		putils12 = new PartsUtilities(Arrays.asList(iss1, iss2), utils12);
-
-		// utils3 has weight N02.
-		Map<ProductOfValue, BigDecimal> utils3 = new HashMap<>();
-		utils3.put(new ProductOfValue(Arrays.asList(lo)), N08.multiply(N02));
-		utils3.put(new ProductOfValue(Arrays.asList(hi)), N07.multiply(N02));
-		putils3 = new PartsUtilities(Arrays.asList(iss3), utils3);
-
-		Map<ProductOfValue, BigDecimal> utils3b = new HashMap<>();
-		utils3b.put(new ProductOfValue(Arrays.asList(lo)), N07.multiply(N02));
-		utils3b.put(new ProductOfValue(Arrays.asList(hi)), N08.multiply(N02));
-		putils3b = new PartsUtilities(Arrays.asList(iss3), utils3b);
-
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		partutils.put("3", putils3);
-
-		sog1 = new SumOfGroupsUtilitySpace(domain, "testspace", partutils,
-				resBid);
-		sog1a = new SumOfGroupsUtilitySpace(domain, "testspace", partutils,
-				resBid);
-		sog2 = new SumOfGroupsUtilitySpace(domain, "testspace2", partutils,
-				resBid);
-
-		// reuse partutils. Also checks that the values have been copied
-		partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		partutils.put("3", putils3b);
-		sog3 = new SumOfGroupsUtilitySpace(domain, "testspace", partutils,
-				resBid);
-
-	}
-
-	@Override
-	public List<List<SumOfGroupsUtilitySpace>> getGeneralTestData() {
-		return Arrays.asList(Arrays.asList(sog1, sog1a), Arrays.asList(sog2),
-				Arrays.asList(sog3));
-	}
-
-	@Override
-	public List<String> getGeneralTestStrings() {
-		return Arrays.asList(
-				"SumOfGroupsUtilitySpace.*testspace.*1and2.*PartsUtilities.*issue1.*issue2.*3.*PartsUtilities.*Bid.*issue1.*high.*",
-				"SumOfGroupsUtilitySpace.*testspace2.*1and2.*PartsUtilities.*issue1.*issue2.*3.*PartsUtilities.*Bid.*issue1.*high.*",
-				"SumOfGroupsUtilitySpace.*testspace.*1and2.*PartsUtilities.*issue1.*issue2.*3.*PartsUtilities.*Bid.*issue1.*high.*");
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void smokeTestIncompleteProfile() {
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		new SumOfGroupsUtilitySpace(domain, "testspace", partutils, resBid);
-
-	}
-
-	@Test // non-normalized utils should be fine in this case
-	public void smokeTestWeightsNotNormalized() {
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		partutils.put("3", putils3);
-		new SumOfGroupsUtilitySpace(domain, "testspace", partutils, resBid);
-
-	}
-
-	@Test(expected = IllegalArgumentException.class)
-	public void smokeTestExtraIssue() {
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		partutils.put("3", putils3);
-		partutils.put("4", putils3);
-		new SumOfGroupsUtilitySpace(domain, "testspace", partutils, resBid);
-
-	}
-
-	@Test
-	public void smokeTest() {
-		makeBasic();
-	}
-
-	@Test
-	public void testName() {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		assertEquals("testspace", paus.getName());
-	}
-
-	@Test
-	public void testDomain() {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		assertEquals(domain, paus.getDomain());
-	}
-
-	@Test
-	public void testGetResBid() {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		assertEquals(resBid, paus.getReservationBid());
-	}
-
-	@Test
-	public void testGetUtilityEmptyBid() {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		assertTrue(BigDecimal.ZERO.compareTo(
-				paus.getUtility(new Bid(Collections.emptyMap()))) == 0);
-	}
-
-	@Test
-	public void testGetUtility() {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		Map<String, Value> map = new HashMap<>();
-		map.put(iss1, lo);
-		map.put(iss2, lo); // 1,2 combined has util 0.2
-		map.put(iss3, hi); // 3 has util 0.7
-		// weights are set to 0.8, 0.2. Gives total util 0.3
-		Bid bid = new Bid(map);
-		assertTrue(N03.compareTo(paus.getUtility(bid)) == 0);
-	}
-
-	/**
-	 * Demonstrates how to convert {@link LinearAdditiveUtilitySpace} to a
-	 * {@link SumOfGroupsUtilitySpace}
-	 * 
-	 */
-	@Test
-	public void testConvertLas() throws IOException {
-		String profile = new String(
-				Files.readAllBytes(Paths.get("src/test/resources/party1.json")),
-				StandardCharsets.UTF_8);
-		LinearAdditiveUtilitySpace las = jackson.readValue(profile,
-				LinearAdditiveUtilitySpace.class);
-		SumOfGroupsUtilitySpace pas = SumOfGroupsUtilitySpace.create(las);
-		checkUtilitiesAllEqual(las, pas);
-		System.out.println("Generated partial profile:\n" + pas);
-	}
-
-	/**
-	 * Demonstrates how to convert {@link LinearAdditiveUtilitySpace} to a
-	 * {@link SumOfGroupsUtilitySpace} and group some issues
-	 * 
-	 */
-	@Test
-	public void testConvertAndGroupParty() throws IOException {
-		String profile = new String(
-				Files.readAllBytes(Paths.get("src/test/resources/party1.json")),
-				StandardCharsets.UTF_8);
-		LinearAdditiveUtilitySpace las = jackson.readValue(profile,
-				LinearAdditiveUtilitySpace.class);
-		SumOfGroupsUtilitySpace pas = SumOfGroupsUtilitySpace.create(las);
-		pas = pas.group(Arrays.asList("Food", "Drinks"), "food&drinks");
-		checkUtilitiesAllEqual(las, pas);
-		System.out.println("Re-grouped party profile:\n");
-		System.out.println(jackson.writeValueAsString(pas));
-
-	}
-
-	@Test
-	public void testGroupe2e() {
-		Map<ProductOfValue, BigDecimal> utils1 = new HashMap<>();
-		utils1.put(new ProductOfValue(Arrays.asList(lo)), N02.multiply(N02));
-		utils1.put(new ProductOfValue(Arrays.asList(hi)), N03.multiply(N02));
-		Map<ProductOfValue, BigDecimal> utils2 = new HashMap<>();
-		utils2.put(new ProductOfValue(Arrays.asList(lo)), N07.multiply(N03));
-		utils2.put(new ProductOfValue(Arrays.asList(hi)), N02.multiply(N03));
-		Map<ProductOfValue, BigDecimal> utils3 = new HashMap<>();
-		utils3.put(new ProductOfValue(Arrays.asList(lo)), N05.multiply(N05));
-		utils3.put(new ProductOfValue(Arrays.asList(hi)), N08.multiply(N05));
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put(iss1, new PartsUtilities(Arrays.asList(iss1), utils1));
-		partutils.put(iss2, new PartsUtilities(Arrays.asList(iss2), utils2));
-		partutils.put(iss3, new PartsUtilities(Arrays.asList(iss3), utils3));
-
-		Map<String, ValueSet> issvalues = new HashMap<>();
-		issvalues.put(iss1, new DiscreteValueSet(lo, hi));
-		issvalues.put(iss2, new DiscreteValueSet(lo, hi));
-		issvalues.put(iss3, new DiscreteValueSet(lo, hi));
-		Domain domain1 = new Domain("test", issvalues);
-
-		SumOfGroupsUtilitySpace pas = new SumOfGroupsUtilitySpace(domain1,
-				"testspace", partutils, resBid);
-
-		SumOfGroupsUtilitySpace pasgrouped12 = pas
-				.group(Arrays.asList(iss1, iss2), "iss12");
-
-		checkEqualUtilities(pas, pasgrouped12);
-
-	}
-
-	@Test
-	public void testSerialize() throws JsonProcessingException {
-		SumOfGroupsUtilitySpace paus = makeBasic();
-		ObjectMapper jackson = new ObjectMapper();
-		String string = jackson.writeValueAsString(paus);
-		System.out.println(string);
-		assertEquals(serialized, string);
-
-	}
-
-	@Test
-	public void testDeserialize() throws IOException {
-		ObjectMapper jackson = new ObjectMapper();
-		assertEquals(makeBasic(), jackson.readValue(serialized, Profile.class));
-
-	}
-
-	@Test
-	public void loadComputerBuy() throws IOException {
-		UtilitySpace space = jackson.readValue(
-				getClass().getResourceAsStream("/computerbuy.json"),
-				UtilitySpace.class);
-		assertTrue(space instanceof SumOfGroupsUtilitySpace);
-
-	}
-
-	@Test
-	public void loadComputerSell() throws IOException {
-		UtilitySpace space = jackson.readValue(
-				getClass().getResourceAsStream("/computersell.json"),
-				UtilitySpace.class);
-		assertTrue(space instanceof LinearAdditiveUtilitySpace);
-
-	}
-
-	@Test(expected = ValueInstantiationException.class)
-	public void loadComputerBuyIncomplete() throws IOException {
-		UtilitySpace space = jackson.readValue(
-				getClass().getResourceAsStream("/computerbuyincomplete.json"),
-				UtilitySpace.class);
-		assertTrue(space instanceof LinearAdditiveUtilitySpace);
-
-	}
-
-	@Test
-	public void loadComputerBuyNumbers() throws IOException {
-		UtilitySpace space = jackson.readValue(
-				getClass().getResourceAsStream("/computerbuynumbers.json"),
-				UtilitySpace.class);
-		assertTrue(space instanceof SumOfGroupsUtilitySpace);
-
-	}
-
-	@Test
-	public void testComputerBuyUtility()
-			throws JsonParseException, JsonMappingException, IOException {
-		SumOfGroupsUtilitySpace space = jackson.readValue(
-				getClass().getResourceAsStream("/computerbuy.json"),
-				SumOfGroupsUtilitySpace.class);
-		Bid bid = space.getReservationBid();
-		assertEquals(new BigDecimal("0.625"), space.getUtility(bid));
-	}
-
-	/************************ PRIVATE FUNCTIONS *******************/
-
-	private void checkEqualUtilities(UtilitySpace space1, UtilitySpace space2) {
-		for (Bid bid : new MyAllBidsList(space1.getDomain())) {
-			assertEquals(space1.getUtility(bid), space2.getUtility(bid));
-		}
-	}
-
-	private SumOfGroupsUtilitySpace makeBasic() {
-		HashMap<String, PartsUtilities> partutils = new HashMap<>();
-		partutils.put("1and2", putils12);
-		partutils.put("3", putils3);
-		return new SumOfGroupsUtilitySpace(domain, "testspace", partutils,
-				resBid);
-
-	}
-
-	private void checkUtilitiesAllEqual(UtilitySpace space1,
-			UtilitySpace space2) {
-		for (Bid bid : new MyAllBidsList(space1.getDomain())) {
-			assertTrue(space1.getUtility(bid)
-					.compareTo(space2.getUtility(bid)) == 0);
-		}
-	}
-
-}
-
-/**
- * Copy of AllBidsList. We can not depend on BidSpace because that would cause a
- * cyclic dependency.
- */
-class MyAllBidsList extends AbstractImmutableList<Bid> {
-
-	private final List<String> issues;
-	private final Outer<? extends Value> allValuePermutations;
-
-	/**
-	 * A list containing all bids in the space. This is an ImmutableList so it
-	 * can contain all bids without pre-computing them.
-	 * 
-	 */
-	public MyAllBidsList(Domain domain) {
-		if (domain == null)
-			throw new IllegalArgumentException("domain=null");
-		issues = new ArrayList<>(domain.getIssues());
-
-		List<ImmutableList<Value>> values = issues.stream()
-				.map(issue -> domain.getValues(issue))
-				.collect(Collectors.toList());
-
-		allValuePermutations = new Outer<Value>(values);
-	}
-
-	@Override
-	public Bid get(BigInteger index) {
-		ImmutableList<? extends Value> nextValues = allValuePermutations
-				.get(index);
-
-		Map<String, Value> issueValues = new HashMap<>();
-		for (int n = 0; n < issues.size(); n++) {
-			issueValues.put(issues.get(n),
-					nextValues.get(BigInteger.valueOf(n)));
-		}
-		return new Bid(issueValues);
-	}
-
-	@Override
-	public BigInteger size() {
-		return allValuePermutations.size();
-	}
-
-}
