anchor.diff:  write_then_read_test() ->
      Channel = create(666),
      M       = self(),
  -   spawn(fun() ->                   M ! { write,write(Channel,123) } end),
  -   spawn(fun() -> timer:sleep(500), M ! { read, read (Channel)     } end),
  +   spawn(fun() ->                   M ! { a,write(Channel,123) } end),
  +   spawn(fun() -> timer:sleep(250), M ! { b,read (Channel)     } end),
      ?assertEqual({ok,{ok,123}},wait(undefined,undefined)),
      ?assertEqual(closed,close(Channel)).
   
   read_then_write_test() ->
      Channel = create(666),
      M       = self(),
  -   spawn(fun() ->                   M ! { read, read (Channel)     } end),
  -   spawn(fun() -> timer:sleep(500), M ! { write,write(Channel,123) } end),
  -   ?assertEqual({ok,{ok,123}},wait(undefined,undefined)),
  +   spawn(fun() ->                   M ! { a,read (Channel)     } end),
  +   spawn(fun() -> timer:sleep(250), M ! { b,write(Channel,123) } end),
  +   ?assertEqual({{ok,123},ok},wait(undefined,undefined)),
      ?assertEqual(closed,close(Channel)).
  - 
  -wait({write,W},{read,R}) ->
  -   {W,R};
  - 
  -wait(W,R) ->
  +
  +write_then_close_test() ->
  +   Channel = create(666),
  +   M       = self(),
  +   spawn(fun() ->                   M ! { a,write(Channel,123) } end),
  +   spawn(fun() -> timer:sleep(250), M ! { b,close(Channel)     } end),
  +   ?assertEqual({closed,closed},wait(undefined,undefined)).
  +
  +read_then_close_test() ->
  +   Channel = create(666),
  +   M       = self(),
  +   spawn(fun() ->                   M ! { a,read (Channel) } end),
  +   spawn(fun() -> timer:sleep(250), M ! { b,close(Channel) } end),
  +   ?assertEqual({closed,closed},wait(undefined,undefined)).
  +   
  +wait({a,X},{b,Y}) ->
  +   {X,Y};
  +
  +wait(X,Y) ->
      receive 
  -      { read,RV } ->
  -         wait(W,{read,RV});
  -
  -      { write,WV } ->
  -         wait({write,WV},R);
  -
  -      _any ->
  -         wait(W,R)
  -   end.
  -
  +      { a,A } ->
  +         wait({a,A},Y);
  +
  +      { b,B } ->
  +         wait(X,{b,B});
  +
  +      _any ->
  +         wait(X,Y)
  +   end.
  +
  
positive.code: 
     receive
        { close,PID } ->
           PID ! { closed,{channel,ID} },
           closed;
  
        { write,Word,WRITER } ->
           case State#state.state of 
  
negative.code:       { written,{channel,ID} } ->
           ok;
  
        { closed,{channel,ID} } ->
           closed;
  
        _any ->
           write_wait(ID,Timeout)
  
  