anchor.diff:  %%% Commands
   %%%===================================================================
   
  -sync_join_cluster(Node, [JoinedNode|_]=JoinedNodes) ->
  -    command_preamble(Node, [sync_join_cluster, JoinedNodes]),
  -
  -    Result = case is_joined(Node, JoinedNodes) of
  -        true ->
  -            ok;
  -        false ->
  -            debug("sync_join_cluster: joining node ~p to node ~p", [Node, JoinedNode]),
  -
  -            %% Get my information.
  -            Myself = rpc:call(?NAME(Node), partisan_peer_service_manager, myself, []),
  -
  -            %% Issue join.
  -            ok = rpc:call(?NAME(JoinedNode), ?MANAGER, join, [Myself]),
  -
  -            %% Wait until all nodes agree about membership.
  -            ok = wait_until_nodes_agree_on_membership(JoinedNodes ++ [Node]),
  -
  -            ok
  -    end,
  -
  -    command_conclusion(Node, [sync_join_cluster, JoinedNodes]),
  -
  -    Result.
  -
  -sync_leave_cluster(Node, [JoinedNode|_]=JoinedNodes) ->
  -    command_preamble(Node, [sync_leave_cluster, JoinedNodes]),
  -
  -    Result = case enough_nodes_connected_to_issue_remove(JoinedNodes) of
  -        false ->
  -            ok;
  -        true ->
  -            debug("sync_leave_cluster: leaving node ~p from cluster with members ~p", [Node, JoinedNodes]),
  -
  -            %% Get my information.
  -            Myself = rpc:call(?NAME(Node), partisan_peer_service_manager, myself, []),
  -
  -            %% Issue remove.
  -            ok = rpc:call(?NAME(JoinedNode), ?MANAGER, leave, [Myself]),
  -
  -            %% Wait until all nodes agree about membership.
  -            ok = wait_until_nodes_agree_on_membership(JoinedNodes -- [Node]),
  -
  -            ok
  -    end,
  -
  -    command_conclusion(Node, [sync_leave_cluster, JoinedNodes]),
  -
  -    Result.
  +sync_join_cluster(Node, JoinNode) ->
  +    command_preamble(Node, [sync_join_cluster, JoinNode]),
  +
  +    %% Get an existing member of the cluster.
  +    {ok, Members} = rpc:call(?NAME(JoinNode), ?MANAGER, members, []),
  +    debug("sync_join_cluster: joining node ~p to cluster at node ~p with current members ~p", 
  +          [?NAME(Node), ?NAME(JoinNode), Members]),
  +
  +    %% Get my information.
  +    Myself = rpc:call(?NAME(Node), partisan_peer_service_manager, myself, []),
  +
  +    %% Issue remove.
  +    ok = rpc:call(?NAME(JoinNode), ?MANAGER, join, [Myself]),
  +
  +    %% Wait until all nodes agree about membership.
  +    DesiredMembership = Members ++ [?NAME(Node)],
  +    debug("=> nodes should wait for desired membership: ~p", [DesiredMembership]),
  +    ok = wait_until_nodes_agree_on_membership(DesiredMembership),
  +
  +    %% Return new membership, make sure it matches model state.
  +    {ok, NewMembers} = rpc:call(JoinNode, ?MANAGER, members, []),
  +    debug("=> members after transition are: ~p", [NewMembers]),
  +
  +    command_conclusion(Node, [sync_join_cluster, JoinNode]),
  +
  +    {ok, NewMembers}.
  +
  +sync_leave_cluster(Node) ->
  +    command_preamble(Node, [sync_leave_cluster]),
  +
  +    %% Get an existing member of the cluster.
  +    {ok, Members} = rpc:call(?NAME(Node), ?MANAGER, members, []),
  +    debug("sync_leave_cluster: leaving node ~p from cluster with current members ~p", 
  +          [?NAME(Node), Members]),
  +
  +    %% Select first member of membership -- *that's not us*.
  +    FirstMember = hd(lists:filter(fun(N) -> N =/= ?NAME(Node) end, Members)),
  +
  +    %% Get my information.
  +    Myself = rpc:call(?NAME(Node), partisan_peer_service_manager, myself, []),
  +
  +    %% Issue remove.
  +    ok = rpc:call(FirstMember, ?MANAGER, leave, [Myself]),
  +
  +    %% Wait until all nodes agree about membership.
  +    DesiredMembership = Members -- [?NAME(Node)],
  +    debug("=> nodes should wait for desired membership: ~p", [DesiredMembership]),
  +    ok = wait_until_nodes_agree_on_membership(DesiredMembership),
  +
  +    %% Return new membership, make sure it matches model state.
  +    {ok, NewMembers} = rpc:call(FirstMember, ?MANAGER, members, []),
  +    debug("=> members after transition are: ~p", [NewMembers]),
  +
  +    command_conclusion(Node, [sync_leave_cluster]),
  +
  +    {ok, NewMembers}.
   
   %%%===================================================================
   %%% Helper Functions
  
positive.code:             precondition_debug("precondition sync_join_cluster: no nodes left to join.", []),
              false %% Might need to be changed when there's no read/write operations.
      end;
  precondition(#state{joined_nodes=JoinedNodes}, {call, _Mod, sync_leave_cluster, [Node, JoinedNodes]}) -> 
      %% Only allow dropping of the last node in the join list, for ease of debugging.
      precondition_debug("precondition sync_leave_cluster: invoked for node ~p joined_nodes ~p", [Node, JoinedNodes]),
  
  
negative.code: wait_until_nodes_agree_on_membership(Nodes) ->
      AgreementFun = fun(Node) ->
          %% Get membership at node.
          {ok, Members} = rpc:call(Node, ?MANAGER, members, []),
  
          %% Sort.
          SortedNodes = lists:usort(Nodes),
          SortedMembers = lists:usort(Members),
  
          %% Ensure the lists are the same -- barrier for proceeding.
          case SortedNodes =:= SortedMembers of
              true ->
                  debug("node ~p agrees on membership: ~p", 
                        [Node, SortedMembers]),
                  true;
              false ->
                  debug("node ~p disagrees on membership: ~p != ~p", 
                        [Node, SortedMembers, SortedNodes]),
                  error
          end
      end,
  