@Test
public void testAddStatements() {

	// Inserting new P2 statements won't touch existing P1 statement
	Statement s1 = StatementBuilder.forSubjectAndProperty(Q1, P1)
			.withValue(Q1).withId("ID-s1").build();
	Statement s2 = StatementBuilder.forSubjectAndProperty(Q1, P2)
			.withValue(Q1).withId("ID-s2").build();
	Statement s3 = StatementBuilder.forSubjectAndProperty(Q1, P2)
			.withValue(Q2).build();
	Statement s4 = StatementBuilder.forSubjectAndProperty(Q1, P2)
			.withValue(Q3).build();
	ItemDocument currentDocument = ItemDocumentBuilder.forItemId(Q1)
			.withStatement(s1).withStatement(s2).build();
	StatementUpdate su = new StatementUpdate(currentDocument,
			Arrays.asList(s3, s4), Collections.emptyList());
	assertEquals(0, su.toDelete.size());
	assertEquals(1, su.toKeep.size());
	assertTrue(su.toKeep.containsKey(P2));
	assertEquals(3, su.toKeep.get(P2).size());
	assertEquals(s3, su.toKeep.get(P2).get(0).statement);
	assertTrue(su.toKeep.get(P2).get(0).write);
	assertEquals(s4, su.toKeep.get(P2).get(1).statement);
	assertTrue(su.toKeep.get(P2).get(1).write);
	assertEquals(s2, su.toKeep.get(P2).get(2).statement);
	assertFalse(su.toKeep.get(P2).get(2).write);
	assertEquals("{\"claims\":[" + JsonSerializer.getJsonString(s3) + ","
			+ JsonSerializer.getJsonString(s4) + "]}",
			su.getJsonUpdateString());
}