anchor.diff:      {
         session.setInterestedIn<%= graph.name %>( false );
   <% end -%>
  -      org.realityforge.replicant.server.ee.EntityMessageCacheUtil.getSessionChanges().addAction( new org.realityforge.replicant.server.ChannelAction( new org.realityforge.replicant.server.ChannelDescriptor( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %>.ordinal(), <%= graph.instance_root? ? 'id' : 'null' %> ), org.realityforge.replicant.server.ChannelAction.Action.REMOVE ) );
  +      org.realityforge.replicant.server.ee.EntityMessageCacheUtil.getSessionChanges().addAction( new org.realityforge.replicant.server.ChannelAction( new org.realityforge.replicant.server.ChannelDescriptor( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %>.ordinal(), <%= graph.instance_root? ? 'id' : 'null' %> ), org.realityforge.replicant.server.ChannelAction.Action.REMOVE, null ) );
       }
     }
   <% end %>
  +<% if repository.imit.graphs.any?{|g| !g.filter_parameter.nil? } -%>
  +  private javax.json.JsonObject toJsonObject( final Object filter )
  +  {
  +    try
  +    {
  +      try ( final javax.json.JsonReader reader = _readerFactory.createReader( new java.io.StringReader( _jsonMapper.writeValueAsString( filter ) ) ) )
  +      {
  +        return reader.readObject();
  +      }
  +    }
  +    catch ( java.io.IOException ioe )
  +    {
  +      throw new IllegalStateException( ioe.getMessage(), ioe );
  +    }
  +  }
  +<% end -%>
   }
  
positive.code:   }
  <% end -%>
  
    private void populateChangeSetFor<%= graph.name %>( @javax.annotation.Nonnull final <%= repository.imit.qualified_session_name %> session, @javax.annotation.Nullable final java.io.Serializable subChannelID, @javax.annotation.Nonnull final org.realityforge.replicant.server.ChangeSet changeSet, final org.realityforge.replicant.server.EntityMessageSet messages )
    {
      changeSet.mergeAll( org.realityforge.replicant.server.ChangeUtil.toChanges( messages.getEntityMessages(), <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %>.ordinal(), null == subChannelID ? 0 : subChannelID ) );
      changeSet.addAction( new org.realityforge.replicant.server.ChannelAction( new org.realityforge.replicant.server.ChannelDescriptor( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %>.ordinal(), subChannelID ), org.realityforge.replicant.server.ChannelAction.Action.ADD ) );
    }
  
  <% if graph.filter_parameter -%>
  
negative.code: public abstract class <%= repository.imit.session_manager_name %>
    extends org.realityforge.replicant.server.transport.ReplicantSessionManager<<%= repository.imit.qualified_session_name %>>
  {
  <% if repository.imit.graphs.any?{|g| !g.filter_parameter.nil? } -%>
    private transient final org.codehaus.jackson.map.ObjectMapper _jsonMapper = new org.codehaus.jackson.map.ObjectMapper();
    private transient final javax.json.JsonReaderFactory _readerFactory = javax.json.Json.createReaderFactory( null );
  <% end -%>
    @javax.inject.Inject
    private <%= repository.imit.qualified_graph_encoder_name %> _encoder;
  
  