anchor.diff:  
   -define(HB_INTERVAL, 100).
   -define(DECAY_WINDOW, 4). %% 4 is friendly to base 2 float arith
  +-define(DOWN_THRESHOLD, 0.25).
   
   -include_lib("eunit/include/eunit.hrl").
  +
  +-define(ASSERT_UP(Node), ?assertMatch({online, {available, _}}, ?NS:status(Node)) ).
  +-define(ASSERT_DOWN(Node), ?assertMatch({online, {unavailable, _}}, ?NS:status(Node)) ).
  +
  +basic_setup() ->
  +    test_util:start_apps(),
  +    pushy_node_stats:init(),
  +    meck:new(pushy_command_switch, []),
  +    meck:expect(pushy_command_switch, send,
  +                fun(_NodeRef,  _Message) -> ok end),
  +    meck:expect(pushy_command_switch, send_command,
  +                fun(_NodeRef,  _Message) -> ok end),
  +    application:set_env(pushy, heartbeat_interval, ?HB_INTERVAL),
  +    application:set_env(pushy, decay_window, ?DECAY_WINDOW),
  +    application:set_env(pushy, down_threshold, ?DOWN_THRESHOLD),
  +    ok.
  +
  +
  +basic_cleanup() ->
  +    ets:delete(pushy_node_stats),
  +    meck:unload(pushy_command_switch).
  +
  +
   
   init_test_() ->
       {foreach,
  -     fun() ->
  -             test_util:start_apps(),
  -             application:set_env(pushy, heartbeat_interval, ?HB_INTERVAL),
  -             application:set_env(pushy, decay_window, ?DECAY_WINDOW),
  -             ok
  -     end,
  +     fun basic_setup/0,
        fun(_) ->
  +             basic_cleanup(),
                ok
        end,
        [fun(_) ->
  
positive.code: watcher_test_() ->
      {foreach,
       fun() ->
               test_util:start_apps(),
               meck:new(pushy_command_switch, []),
               meck:expect(pushy_command_switch, send_command,
                           fun(_NodeRef,  _Message) -> ok end),
               application:set_env(pushy, heartbeat_interval, ?HB_INTERVAL),
               {ok, Pid} = ?NS:start_link(?NODE),
               {Pid}
       end,
       fun({Pid}) ->
               meck:unload(pushy_command_switch),
               erlang:unlink(Pid),
               erlang:exit(Pid, kill),
               ok
  
negative.code:       fun(_) ->
                {"Start it up, send hb, check state until we drive it into 'up'",
                 fun() ->
                         ?NS:watch(?NODE),
                         ?NS:heartbeat(?NODE),
                         heartbeat_step(?NODE, ?HB_INTERVAL, 6),
                         ?NS:aborted(?NODE),
                         ?ASSERT_UP(?NODE)
                 end}
        end,
        fun(_) ->
                {"Start it up, send hb, check state until we drive it into 'up', then wait until it goes down",
                 fun() ->
                         ?NS:watch(?NODE),
                         heartbeat_step(?NODE, ?HB_INTERVAL, 6),
                         ?NS:aborted(?NODE),
                         ?ASSERT_UP(?NODE),
  
                         timer:sleep(?HB_INTERVAL*7),
                         ?ASSERT_DOWN(?NODE),
  
                         assertReceive({down, ?NODE})
                 end}
        end
       ]}.
  
  heartbeat_step(_Node, _SleepTime, 0) ->
      ok;
  