anchor.diff:      remove_subscriber(Pid, P).
   
   send(Message, #pubsub{subscribers=Subs}) ->
  -    [ Pid ! Message || Pid <- Subs ],
  +    [ Pid ! Message
  +      || #sub{pid=Pid, filter=Fn} <- Subs,
  +         Fn =:= ?FILTER_ALL orelse
  +         Fn(Message) ],
       ok.
   
  -subscribed(Pid, #pubsub{subscribers=Subs}) ->
  -    lists:member(Pid, Subs).
  +subscribed(Pid, #pubsub{subscribers=Subs}) when is_pid(Pid) ->
  +    lists:keymember(Pid, #sub.pid, Subs).
   
   %%====================================================================
   %% Internal functions
   %%====================================================================
   
   sub_test() ->
  -    P1 = publish(),
  +    P1 = new(),
       Pid = self(),
       P2 = process_msg({sub, Pid}, P1),
       ?assertMatch(true, subscribed(Pid, P2)),
  
positive.code: -module(pubsub).
  
  %% API
  -export([publish/0
           ,add_subscriber/2
           ,remove_subscriber/2
           ,process_msg/2
  
negative.code:         ]).
  
  -record(pubsub, {subscribers = []}).
  -define(FILTER_ALL, all).
  -record(sub, {pid :: pid(),
                filter = ?FILTER_ALL :: function() | 'all'
               }).
  
  -include_lib("eunit/include/eunit.hrl").
  
  -opaque pubsub() :: #pubsub{}.
  
  %%====================================================================
  %% API
  %%====================================================================
  
  new() ->
      #pubsub{}.
  
  sync_subscribe(Publisher) ->
  