Program: 15507
Project: 15507
Buggy source:
@Test public void testTapDoesntHurtStream() throws Exception {
  LocalMessageBus bus=(LocalMessageBus)getMessageBus();
  DirectChannel moduleOutputChannel=new DirectChannel();
  moduleOutputChannel.setBeanName("String_Node_Str");
  DirectChannel tapChannel=new DirectChannel();
  tapChannel.setBeanName("String_Node_Str");
  WireTap tap=new WireTap(tapChannel);
  moduleOutputChannel.addInterceptor(tap);
  bus.bindProducer("String_Node_Str",moduleOutputChannel,null);
  final AtomicBoolean messageReceived=new AtomicBoolean();
  final AtomicReference<Thread> streamThread=new AtomicReference<Thread>();
  bus.bindConsumer("String_Node_Str",new DirectChannel(){
    @Override protected boolean doSend(    Message<?> message,    long timeout){
      messageReceived.set(true);
      streamThread.set(Thread.currentThread());
      return true;
    }
  }
,null);
  final CountDownLatch tapped=new CountDownLatch(1);
  final AtomicReference<Thread> tapThread=new AtomicReference<Thread>();
  bus.bindPubSubProducer("String_Node_Str",tapChannel,null);
  bus.bindPubSubConsumer("String_Node_Str",new DirectChannel(){
    @Override protected boolean doSend(    Message<?> message,    long timeout){
      tapped.countDown();
      tapThread.set(Thread.currentThread());
      throw new RuntimeException("String_Node_Str");
    }
  }
,null);
  moduleOutputChannel.send(new GenericMessage<String>("String_Node_Str"));
  assertTrue(tapped.await(10,TimeUnit.SECONDS));
  assertTrue(messageReceived.get());
  assertSame(Thread.currentThread(),streamThread.get());
  assertNotNull(tapThread.get());
  assertNotSame(Thread.currentThread(),tapThread.get());
}

Fixed version (ground truth):
@Test public void testTapDoesntHurtStream() throws Exception {
  LocalMessageBus bus=(LocalMessageBus)getMessageBus();
  DirectChannel moduleOutputChannel=new DirectChannel();
  moduleOutputChannel.setBeanName("String_Node_Str");
  DirectChannel tapChannel=new DirectChannel();
  tapChannel.setBeanName("String_Node_Str");
  WireTap tap=new WireTap(tapChannel);
  moduleOutputChannel.addInterceptor(tap);
  bus.bindProducer("String_Node_Str",moduleOutputChannel,null);
  final AtomicBoolean messageReceived=new AtomicBoolean();
  final AtomicReference<Thread> streamThread=new AtomicReference<Thread>();
  bus.bindConsumer("String_Node_Str",new DirectChannel(){
    @Override protected boolean doSend(    Message<?> message,    long timeout){
      messageReceived.set(true);
      streamThread.set(Thread.currentThread());
      return true;
    }
  }
,null);
  final CountDownLatch tapped=new CountDownLatch(1);
  final AtomicReference<Thread> tapThread=new AtomicReference<Thread>();
  bus.bindPubSubProducer("String_Node_Str",tapChannel,null);
  bus.bindPubSubConsumer("String_Node_Str",new DirectChannel(){
    @Override protected boolean doSend(    Message<?> message,    long timeout){
      tapThread.set(Thread.currentThread());
      tapped.countDown();
      throw new RuntimeException("String_Node_Str");
    }
  }
,null);
  moduleOutputChannel.send(new GenericMessage<String>("String_Node_Str"));
  assertTrue(tapped.await(10,TimeUnit.SECONDS));
  assertTrue(messageReceived.get());
  assertSame(Thread.currentThread(),streamThread.get());
  assertNotNull(tapThread.get());
  assertNotSame(Thread.currentThread(),tapThread.get());
}