@Test
public void testSetAttributes() {

	// mixed
	Map<String, Attribute<?>> attrs = new HashMap<String, Attribute<?>>();
	attrs.put("orig", new ManyToOneAttribute());
	AssociationValue value = new AssociationValue(new StringAttribute("1"), attrs, false);
	Map<String, PrimitiveAttribute<?>> attrs2 = new HashMap<String, PrimitiveAttribute<?>>();
	attrs2.put("new", new StringAttribute("new"));
	try {
		value.setAttributes(attrs2);
		Assert.fail("Primitive attributes passed to mixed value");
	} catch (UnsupportedOperationException uoe) {
	}
	
	// primitive
	Map<String, Attribute<?>> attrs3 = new HashMap<String, Attribute<?>>();
	attrs3.put("orig", new StringAttribute("orig"));
	AssociationValue value2 = new AssociationValue(new StringAttribute("1"), attrs3, true);
	Map<String, PrimitiveAttribute<?>> attrs4 = new HashMap<String, PrimitiveAttribute<?>>();
	attrs4.put("new", new StringAttribute("new"));
	value2.setAttributes(attrs4);
	Assert.assertSame(attrs4, value2.getAttributes());
}