code: @Nonnull
  	public final TypeSerializer<T> currentSchemaSerializer() {
  		if (registeredSerializer != null) {
  			checkState(
  				!isRegisteredWithIncompatibleSerializer,
  				"Unable to provide a serializer with the current schema, because the restored state was " +
  					"registered with a new serializer that has incompatible schema.");
  
  			return registeredSerializer;
  		}
  
  		// if we are not yet registered with a new serializer,
  		// we can just use the restore serializer to read / write the state.
  		return previousSchemaSerializer();
  	}
docs: Gets the serializer that recognizes the current serialization schema of the state.
  This is the serializer that should be used for regular state serialization and
  deserialization after state has been restored.
  
  <p>If this provider was created from a restored state's serializer snapshot, while a
  new serializer (with a new schema) was not registered for the state (i.e., because
  the state was never accessed after it was restored), then the schema of state remains
  identical. Therefore, in this case, it is guaranteed that the serializer returned by
  this method is the same as the one returned by {@link #previousSchemaSerializer()}.
  
  <p>If this provider was created from a serializer instance, then this always returns the
  that same serializer instance. If later on a snapshot of the previous serializer is supplied
  via {@link #setPreviousSerializerSnapshotForRestoredState(TypeSerializerSnapshot)}, then
  the initially supplied serializer instance will be checked for compatibility.
  
  @return a serializer that reads and writes in the current schema of the state.