anchor.diff:  %%% ---------------------------------------------------------------------------
   -module(erleans_grain).
   
  --behaviour(gen_server).
  +-behaviour(gen_statem).
   
   -export([start_link/1,
            call/2,
  
positive.code: 
  -callback placement() -> erleans:grain_placement().
  
  -callback handle_call(Msg :: term(), From :: pid(), CbState :: cb_state()) ->
      {reply, Reply :: term(), CbState :: cb_state()} |
      {stop, Reason :: term(), Reply :: term(), CbState :: cb_state()}.
  
  -callback handle_cast(Msg :: term(), CbState :: cb_state()) ->
      {noreply, CbState :: cb_state()} |
      {save, CbState :: cb_state()} |
      {save, Updates :: maps:map(), CbState :: cb_state()}.
  
  -callback handle_info(Msg :: term(), CbState :: cb_state()) ->
      {noreply, CbState :: cb_state()} |
      {save, CbState :: cb_state()} |
      {save, Updates :: maps:map(), CbState :: cb_state()}.
  
  -callback deactivate(CbState :: cb_state()) ->
      {ok, State :: cb_state()} |
      {save, State :: cb_state()} |
      {save, Updates :: maps:map(), CbState :: cb_state()}.
  
  -optional_callbacks([provider/0,
                       placement/0]).
  
  -record(state,
         { cb_module            :: module(),
           cb_state             :: cb_state(),
  
  
negative.code:                  implementing_module := CbModule}]) ->
      put(grain_ref, GrainRef),
      process_flag(trap_exit, true),
      {CbData, ETag} = case maps:find(provider, GrainRef) of
                            {ok, Provider={ProviderModule, ProviderName}} ->
                                case ProviderModule:read(CbModule, ProviderName, Id) of
                                    {ok, SavedData, E} ->
                                        {SavedData, E};
                                    _ ->
                                        {#{}, undefined}
                                end;
  