class LexemeDocumentImpl extends StatementDocumentImpl implements LexemeDocument {

	@Override
	public LexemeDocument withSense(SenseDocument sense) {
		if(!sense.getEntityId().getLexemeId().equals(getEntityId())) {
			throw new IllegalArgumentException("The sense " + sense.getEntityId() + " does not belong to lexeme " + getEntityId());
		}

		List<SenseDocument> newSenses = new ArrayList<>(senses);
		newSenses.add(sense);
		return new LexemeDocumentImpl(getEntityId(), lexicalCategory,
				language, lemmas, claims, forms, newSenses,
				revisionId, nextFormId, nextSenseId);
	}

	  LexemeDocumentImpl(
			LexemeIdValue id,
			ItemIdValue lexicalCategory,
			ItemIdValue language,
			List<MonolingualTextValue> lemmas,
			List<StatementGroup> statements,
			List<FormDocument> forms,
			List<SenseDocument> senses,
			long revisionId);
	@JsonCreator  LexemeDocumentImpl(
			@JsonProperty("id") String jsonId,
			@JsonProperty("lexicalCategory") String lexicalCategory,
			@JsonProperty("language") String language,
			@JsonProperty("lemmas") @JsonDeserialize(contentAs=TermImpl.class) Map<String, MonolingualTextValue> lemmas,
			@JsonProperty("claims") Map<String, List<StatementImpl.PreStatement>> claims,
			@JsonProperty("forms") @JsonDeserialize(contentAs=FormDocumentImpl.class) List<FormDocument> forms,
			@JsonProperty("senses") @JsonDeserialize(contentAs=SenseDocumentImpl.class) List<SenseDocument> senses,
			@JsonProperty("lastrevid") long revisionId,
			@JacksonInject("siteIri") String siteIri);
	private  LexemeDocumentImpl(
			LexemeIdValue id,
			ItemIdValue lexicalCategory,
			ItemIdValue language,
			Map<String, MonolingualTextValue> lemmas,
			Map<String, List<Statement>> statements,
			List<FormDocument> forms,
			List<SenseDocument> senses,
			long revisionId,
			int nextFormId,
			int nextSenseId);

}