anchor.diff:      , parameters :: [ binary() ]
       , events     :: [ binary() ]
       , state      :: starting | running | stopping | crashed
  +    , started_by :: term()
  +    , stopped_by :: term()
       } ).
   
   -record( state,
  
positive.code:     , { os_pid, Device#device.os_pid }
      ].
  
  handle_start( Msg, DeviceId, State ) ->
      case Msg of
          { ok, Info } ->
              UpdateDeviceFun = fun( D ) ->
                  D#device{
                    state = running,
                    os_pid = proplists:get_value( os_pid, Info )
                  }
              end,
              Devices = orddict:update(
                  DeviceId,
                  UpdateDeviceFun,
                  State#state.devices
              ),
              State#state{ devices = Devices };
          { error, _Reason } ->
              % FIXME - log
              Devices = orddict:update(
                  DeviceId,
                  fun( D ) -> D#device{ state = crashed } end,
                  State#state.devices
              ),
              State#state{ devices = Devices }
      end.
  
  handle_stop( shutdown, DeviceId, State ) ->
      Devices = orddict:erase( DeviceId, State#state.devices ),
  
negative.code: 
  test_start_response( ok ) ->
      Id = make_ref(),
      Device = #device{ id = Id, started_by = { make_ref(), self() } },
      Devices = orddict:store( Id, Device, orddict:new() ),
      S0 = #state{ devices = Devices },
  
  