test_class.declarator: Q1 = Datamodel.makeWikidataItemIdValue("Q1")
test_class.modifier: final static
test_class.original_string: final static ItemIdValue Q1 = Datamodel.makeWikidataItemIdValue("Q1");
test_class.type: ItemIdValue
test_class.var_name: Q1
test_class.declarator: Q2 = Datamodel.makeWikidataItemIdValue("Q2")
test_class.modifier: final static
test_class.original_string: final static ItemIdValue Q2 = Datamodel.makeWikidataItemIdValue("Q2");
test_class.type: ItemIdValue
test_class.var_name: Q2
test_class.declarator: Q3 = Datamodel.makeWikidataItemIdValue("Q3")
test_class.modifier: final static
test_class.original_string: final static ItemIdValue Q3 = Datamodel.makeWikidataItemIdValue("Q3");
test_class.type: ItemIdValue
test_class.var_name: Q3
test_class.declarator: P1 = Datamodel
  			.makeWikidataPropertyIdValue("P1")
test_class.modifier: final static
test_class.original_string: final static PropertyIdValue P1 = Datamodel
  			.makeWikidataPropertyIdValue("P1");
test_class.type: PropertyIdValue
test_class.var_name: P1
test_class.declarator: P2 = Datamodel
  			.makeWikidataPropertyIdValue("P2")
test_class.modifier: final static
test_class.original_string: final static PropertyIdValue P2 = Datamodel
  			.makeWikidataPropertyIdValue("P2");
test_class.type: PropertyIdValue
test_class.var_name: P2
test_class.declarator: P3 = Datamodel
  			.makeWikidataPropertyIdValue("P3")
test_class.modifier: final static
test_class.original_string: final static PropertyIdValue P3 = Datamodel
  			.makeWikidataPropertyIdValue("P3");
test_class.type: PropertyIdValue
test_class.var_name: P3
test_class.file: wdtk-wikibaseapi/src/test/java/org/wikidata/wdtk/wikibaseapi/StatementUpdateTest.java
test_class.identifier: StatementUpdateTest
test_case.body: @Test
  	public void testMergeReferences() {
  		Reference r1 = ReferenceBuilder.newInstance().withPropertyValue(P1, Q1)
  				.withPropertyValue(P2, Q2).build();
  		Reference r2 = ReferenceBuilder.newInstance().withPropertyValue(P1, Q1)
  				.build();
  		Reference r3 = ReferenceBuilder.newInstance().withPropertyValue(P2, Q2)
  				.build();
  		Reference r4 = ReferenceBuilder.newInstance().withPropertyValue(P2, Q2)
  				.withPropertyValue(P1, Q1).build();
  
  		Statement s1 = StatementBuilder.forSubjectAndProperty(Q1, P1)
  				.withValue(Q1).withReference(r1).withReference(r2)
  				.withId("ID-s1").build();
  		Statement s2 = StatementBuilder.forSubjectAndProperty(Q1, P1)
  				.withValue(Q1).withReference(r3).withReference(r4).build();
  
  		ItemDocument currentDocument = ItemDocumentBuilder.forItemId(Q1)
  				.withStatement(s1).build();
  
  		StatementUpdate su = new StatementUpdate(currentDocument,
  				Collections.singletonList(s2), Collections.emptyList());
  
  		Statement s1merged = StatementBuilder.forSubjectAndProperty(Q1, P1)
  				.withValue(Q1).withReference(r1).withReference(r2)
  				.withReference(r3).withId("ID-s1").build();
  
  		assertEquals(0, su.toDelete.size());
  		assertEquals(1, su.toKeep.size());
  		assertTrue(su.toKeep.containsKey(P1));
  		assertEquals(1, su.toKeep.get(P1).size());
  		assertEquals(s1merged, su.toKeep.get(P1).get(0).statement);
  		assertTrue(su.toKeep.get(P1).get(0).write);
  	}
test_case.class_method_signature: StatementUpdateTest.testMergeReferences()
test_case.full_signature: @Test public void testMergeReferences()
test_case.identifier: testMergeReferences
test_case.invocations: build withPropertyValue withPropertyValue newInstance build withPropertyValue newInstance build withPropertyValue newInstance build withPropertyValue withPropertyValue newInstance build withId withReference withReference withValue forSubjectAndProperty build withReference withReference withValue forSubjectAndProperty build withStatement forItemId singletonList emptyList build withId withReference withReference withReference withValue forSubjectAndProperty assertEquals size assertEquals size assertTrue containsKey assertEquals size get assertEquals get get assertTrue get get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMergeReferences()
focal_class.declarator: logger = LoggerFactory.getLogger(StatementUpdate.class)
focal_class.modifier: static final
focal_class.original_string: static final Logger logger = LoggerFactory.getLogger(StatementUpdate.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: guidGenerator = new RandomGuidGenerator()
focal_class.modifier: private
focal_class.original_string: private GuidGenerator guidGenerator = new RandomGuidGenerator();
focal_class.type: GuidGenerator
focal_class.var_name: guidGenerator
focal_class.declarator: mapper
focal_class.modifier: private final
focal_class.original_string: private final ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: toKeep
focal_class.modifier: @JsonIgnore
  	final
focal_class.original_string: @JsonIgnore
  	final HashMap<PropertyIdValue, List<StatementWithUpdate>> toKeep;
focal_class.type: HashMap<PropertyIdValue, List<StatementWithUpdate>>
focal_class.var_name: toKeep
focal_class.declarator: toDelete
focal_class.modifier: @JsonIgnore
  	final
focal_class.original_string: @JsonIgnore
  	final List<String> toDelete;
focal_class.type: List<String>
focal_class.var_name: toDelete
focal_class.declarator: currentDocument
focal_class.modifier: @JsonIgnore
focal_class.original_string: @JsonIgnore
  	StatementDocument currentDocument;
focal_class.type: StatementDocument
focal_class.var_name: currentDocument
focal_class.file: wdtk-wikibaseapi/src/main/java/org/wikidata/wdtk/wikibaseapi/StatementUpdate.java
focal_class.identifier: StatementUpdate
focal_class.class_method_signature: StatementUpdate.StatementUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.full_signature: public  StatementUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.identifier: StatementUpdate
focal_class.modifiers: public
focal_class.parameters: (StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.signature:  StatementUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.class_method_signature: StatementUpdate.getJsonUpdateString()
focal_class.full_signature: @JsonIgnore public String getJsonUpdateString()
focal_class.identifier: getJsonUpdateString
focal_class.modifiers: @JsonIgnore public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getJsonUpdateString()
focal_class.class_method_signature: StatementUpdate.performEdit(WbEditingAction action, boolean editAsBot, String summary, List<String> tags)
focal_class.full_signature: public StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary, List<String> tags)
focal_class.identifier: performEdit
focal_class.modifiers: public
focal_class.parameters: (WbEditingAction action, boolean editAsBot, String summary, List<String> tags)
focal_class.return: StatementDocument
focal_class.signature: StatementDocument performEdit(WbEditingAction action, boolean editAsBot, String summary, List<String> tags)
focal_class.class_method_signature: StatementUpdate.getUpdatedStatements()
focal_class.full_signature: @JsonProperty("claims") @JsonInclude(Include.NON_EMPTY) public List<Statement> getUpdatedStatements()
focal_class.identifier: getUpdatedStatements
focal_class.modifiers: @JsonProperty("claims") @JsonInclude(Include.NON_EMPTY) public
focal_class.parameters: ()
focal_class.return: List<Statement>
focal_class.signature: List<Statement> getUpdatedStatements()
focal_class.class_method_signature: StatementUpdate.isEmptyEdit()
focal_class.full_signature: @JsonIgnore public boolean isEmptyEdit()
focal_class.identifier: isEmptyEdit
focal_class.modifiers: @JsonIgnore public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmptyEdit()
focal_class.class_method_signature: StatementUpdate.markStatementsForUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.full_signature: protected void markStatementsForUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.identifier: markStatementsForUpdate
focal_class.modifiers: protected
focal_class.parameters: (StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.return: void
focal_class.signature: void markStatementsForUpdate(StatementDocument currentDocument,
  			List<Statement> addStatements, List<Statement> deleteStatements)
focal_class.class_method_signature: StatementUpdate.markStatementsForDeletion(StatementDocument currentDocument,
  			List<Statement> deleteStatements)
focal_class.full_signature: protected void markStatementsForDeletion(StatementDocument currentDocument,
  			List<Statement> deleteStatements)
focal_class.identifier: markStatementsForDeletion
focal_class.modifiers: protected
focal_class.parameters: (StatementDocument currentDocument,
  			List<Statement> deleteStatements)
focal_class.return: void
focal_class.signature: void markStatementsForDeletion(StatementDocument currentDocument,
  			List<Statement> deleteStatements)
focal_class.class_method_signature: StatementUpdate.markStatementsForInsertion(
  			StatementDocument currentDocument, List<Statement> addStatements)
focal_class.full_signature: protected void markStatementsForInsertion(
  			StatementDocument currentDocument, List<Statement> addStatements)
focal_class.identifier: markStatementsForInsertion
focal_class.modifiers: protected
focal_class.parameters: (
  			StatementDocument currentDocument, List<Statement> addStatements)
focal_class.return: void
focal_class.signature: void markStatementsForInsertion(
  			StatementDocument currentDocument, List<Statement> addStatements)
focal_class.class_method_signature: StatementUpdate.addStatement(Statement statement, boolean isNew)
focal_class.full_signature: protected void addStatement(Statement statement, boolean isNew)
focal_class.identifier: addStatement
focal_class.modifiers: protected
focal_class.parameters: (Statement statement, boolean isNew)
focal_class.return: void
focal_class.signature: void addStatement(Statement statement, boolean isNew)
focal_class.class_method_signature: StatementUpdate.mergeStatements(Statement statement1, Statement statement2)
focal_class.full_signature: private Statement mergeStatements(Statement statement1, Statement statement2)
focal_class.identifier: mergeStatements
focal_class.modifiers: private
focal_class.parameters: (Statement statement1, Statement statement2)
focal_class.return: Statement
focal_class.signature: Statement mergeStatements(Statement statement1, Statement statement2)
focal_class.class_method_signature: StatementUpdate.mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_class.full_signature: protected List<Reference> mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_class.identifier: mergeReferences
focal_class.modifiers: protected
focal_class.parameters: (
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_class.return: List<Reference>
focal_class.signature: List<Reference> mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_class.class_method_signature: StatementUpdate.addBestReferenceToList(Reference reference,
  			List<Reference> referenceList)
focal_class.full_signature: protected void addBestReferenceToList(Reference reference,
  			List<Reference> referenceList)
focal_class.identifier: addBestReferenceToList
focal_class.modifiers: protected
focal_class.parameters: (Reference reference,
  			List<Reference> referenceList)
focal_class.return: void
focal_class.signature: void addBestReferenceToList(Reference reference,
  			List<Reference> referenceList)
focal_class.class_method_signature: StatementUpdate.equivalentClaims(Claim claim1, Claim claim2)
focal_class.full_signature: protected boolean equivalentClaims(Claim claim1, Claim claim2)
focal_class.identifier: equivalentClaims
focal_class.modifiers: protected
focal_class.parameters: (Claim claim1, Claim claim2)
focal_class.return: boolean
focal_class.signature: boolean equivalentClaims(Claim claim1, Claim claim2)
focal_class.class_method_signature: StatementUpdate.isSameSnakSet(Iterator<Snak> snaks1, Iterator<Snak> snaks2)
focal_class.full_signature: protected boolean isSameSnakSet(Iterator<Snak> snaks1, Iterator<Snak> snaks2)
focal_class.identifier: isSameSnakSet
focal_class.modifiers: protected
focal_class.parameters: (Iterator<Snak> snaks1, Iterator<Snak> snaks2)
focal_class.return: boolean
focal_class.signature: boolean isSameSnakSet(Iterator<Snak> snaks1, Iterator<Snak> snaks2)
focal_class.class_method_signature: StatementUpdate.setGuidGenerator(GuidGenerator generator)
focal_class.full_signature: public void setGuidGenerator(GuidGenerator generator)
focal_class.identifier: setGuidGenerator
focal_class.modifiers: public
focal_class.parameters: (GuidGenerator generator)
focal_class.return: void
focal_class.signature: void setGuidGenerator(GuidGenerator generator)
focal_class.class_method_signature: StatementUpdate.getRevisionIdFromResponse(JsonNode response)
focal_class.full_signature: protected long getRevisionIdFromResponse(JsonNode response)
focal_class.identifier: getRevisionIdFromResponse
focal_class.modifiers: protected
focal_class.parameters: (JsonNode response)
focal_class.return: long
focal_class.signature: long getRevisionIdFromResponse(JsonNode response)
focal_class.class_method_signature: StatementUpdate.getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass)
focal_class.full_signature: protected T getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass)
focal_class.identifier: getDatamodelObjectFromResponse
focal_class.modifiers: protected
focal_class.parameters: (JsonNode response, List<String> path, Class<T> targetClass)
focal_class.return: T
focal_class.signature: T getDatamodelObjectFromResponse(JsonNode response, List<String> path, Class<T> targetClass)
focal_method.body: protected List<Reference> mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2) {
  		List<Reference> result = new ArrayList<>();
  		for (Reference reference : references1) {
  			addBestReferenceToList(reference, result);
  		}
  		for (Reference reference : references2) {
  			addBestReferenceToList(reference, result);
  		}
  		return result;
  	}
focal_method.class_method_signature: StatementUpdate.mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_method.full_signature: protected List<Reference> mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_method.identifier: mergeReferences
focal_method.invocations: addBestReferenceToList addBestReferenceToList
focal_method.modifiers: protected
focal_method.parameters: (
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)
focal_method.return: List<Reference>
focal_method.signature: List<Reference> mergeReferences(
  			List<? extends Reference> references1,
  			List<? extends Reference> references2)