MediaInfoDocumentImpl extends LabeledStatementDocumentImpl implements MediaInfoDocument { @Override public MediaInfoDocument withStatement(Statement statement) { Map<String, List<Statement>> newGroups = addStatementToGroups(statement, claims); return new MediaInfoDocumentImpl(getEntityId(), labels, newGroups, revisionId); } MediaInfoDocumentImpl(
			MediaInfoIdValue id,
			List<MonolingualTextValue> labels,
			List<StatementGroup> statements,
			long revisionId); @JsonCreator  MediaInfoDocumentImpl(
			@JsonProperty("id") String jsonId,
			@JsonProperty("labels") @JsonDeserialize(contentAs=TermImpl.class) Map<String, MonolingualTextValue> labels,
			@JsonProperty("claims") Map<String, List<StatementImpl.PreStatement>> claims,
			@JsonProperty("statements") Map<String, List<StatementImpl.PreStatement>> statements,
			@JsonProperty("lastrevid") long revisionId,
			@JacksonInject("siteIri") String siteIri); protected  MediaInfoDocumentImpl(
			MediaInfoIdValue subject,
			Map<String, MonolingualTextValue> labels,
			Map<String, List<Statement>> claims,
			long revisionId); @JsonIgnore @Override MediaInfoIdValue getEntityId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override MediaInfoDocument withRevisionId(long newRevisionId); @Override MediaInfoDocument withLabel(MonolingualTextValue newLabel); @Override MediaInfoDocument withStatement(Statement statement); @Override MediaInfoDocument withoutStatementIds(Set<String> statementIds);  }
@Test public void testAddStatement() { Statement fresh = new StatementImpl("MyFreshId", StatementRank.NORMAL, new SomeValueSnakImpl(new PropertyIdValueImpl("P29", "http: Collections.emptyList(), Collections.emptyList(), mid); Claim claim = fresh.getClaim(); assertFalse(mi1.hasStatementValue( claim.getMainSnak().getPropertyId(), claim.getValue())); MediaInfoDocument withStatement = mi1.withStatement(fresh); assertTrue(withStatement.hasStatementValue( claim.getMainSnak().getPropertyId(), claim.getValue())); }