Program: 27443
Project: 27443
Buggy source:
@Test public void testPublishToMultipleSubscribers() throws InterruptedException {
  final Subscription subscription=new Subscription(FAKE_CLIENT_ID,FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,true);
  final Subscription subscriptionClient2=new Subscription(FAKE_CLIENT_ID2,FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,true);
  SubscriptionsStore subs=new SubscriptionsStore(){
    @Override public List<Subscription> matches(    String topic){
      if (topic.equals(FAKE_TOPIC)) {
        return Arrays.asList(subscription,subscriptionClient2);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + FAKE_TOPIC + "String_Node_Str"+ topic);
      }
    }
  }
;
  subs.init(m_storageService);
  m_processor.init(subs,m_storageService);
  MockReceiverChannel firstReceiverSession=new MockReceiverChannel();
  ConnectMessage connectMessage=new ConnectMessage();
  connectMessage.setProcotolVersion((byte)3);
  connectMessage.setClientID(FAKE_CLIENT_ID);
  connectMessage.setCleanSession(subscription.isCleanSession());
  m_processor.processConnect(firstReceiverSession,connectMessage);
  MockReceiverChannel secondReceiverSession=new MockReceiverChannel();
  ConnectMessage connectMessage2=new ConnectMessage();
  connectMessage2.setProcotolVersion((byte)3);
  connectMessage2.setClientID(FAKE_CLIENT_ID2);
  connectMessage2.setCleanSession(subscription.isCleanSession());
  m_processor.processConnect(secondReceiverSession,connectMessage2);
  ByteBuffer buffer=ByteBuffer.allocate(5).put("String_Node_Str".getBytes());
  PublishEvent pubEvt=new PublishEvent(FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,buffer,false,"String_Node_Str",null);
  m_processor.processPublish(pubEvt);
  Thread.sleep(100);
  PublishMessage pub2FirstSubscriber=(PublishMessage)firstReceiverSession.getMessage();
  assertNotNull(pub2FirstSubscriber);
  String firstMessageContent=DebugUtils.payload2Str(pub2FirstSubscriber.getPayload());
  assertEquals("String_Node_Str",firstMessageContent);
  PublishMessage pub2SecondSubscriber=(PublishMessage)secondReceiverSession.getMessage();
  assertNotNull(pub2SecondSubscriber);
  String secondMessageContent=DebugUtils.payload2Str(pub2SecondSubscriber.getPayload());
  assertEquals("String_Node_Str",secondMessageContent);
}

Fixed version (ground truth):
@Test public void testPublishToMultipleSubscribers() throws InterruptedException {
  final Subscription subscription=new Subscription(FAKE_CLIENT_ID,FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,true);
  final Subscription subscriptionClient2=new Subscription(FAKE_CLIENT_ID2,FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,true);
  SubscriptionsStore subs=new SubscriptionsStore(){
    @Override public List<Subscription> matches(    String topic){
      if (topic.equals(FAKE_TOPIC)) {
        return Arrays.asList(subscription,subscriptionClient2);
      }
 else {
        throw new IllegalArgumentException("String_Node_Str" + FAKE_TOPIC + "String_Node_Str"+ topic);
      }
    }
  }
;
  subs.init(m_storageService);
  m_processor.init(subs,m_storageService);
  MockReceiverChannel firstReceiverSession=new MockReceiverChannel();
  ConnectMessage connectMessage=new ConnectMessage();
  connectMessage.setProcotolVersion((byte)3);
  connectMessage.setClientID(FAKE_CLIENT_ID);
  connectMessage.setCleanSession(subscription.isCleanSession());
  m_processor.processConnect(firstReceiverSession,connectMessage);
  MockReceiverChannel secondReceiverSession=new MockReceiverChannel();
  ConnectMessage connectMessage2=new ConnectMessage();
  connectMessage2.setProcotolVersion((byte)3);
  connectMessage2.setClientID(FAKE_CLIENT_ID2);
  connectMessage2.setCleanSession(subscription.isCleanSession());
  m_processor.processConnect(secondReceiverSession,connectMessage2);
  ByteBuffer buffer=ByteBuffer.allocate(5).put("String_Node_Str".getBytes());
  buffer.rewind();
  PublishEvent pubEvt=new PublishEvent(FAKE_TOPIC,AbstractMessage.QOSType.MOST_ONE,buffer,false,"String_Node_Str",null);
  m_processor.processPublish(pubEvt);
  Thread.sleep(100);
  PublishMessage pub2FirstSubscriber=(PublishMessage)firstReceiverSession.getMessage();
  assertNotNull(pub2FirstSubscriber);
  String firstMessageContent=DebugUtils.payload2Str(pub2FirstSubscriber.getPayload());
  assertEquals("String_Node_Str",firstMessageContent);
  PublishMessage pub2SecondSubscriber=(PublishMessage)secondReceiverSession.getMessage();
  assertNotNull(pub2SecondSubscriber);
  String secondMessageContent=DebugUtils.payload2Str(pub2SecondSubscriber.getPayload());
  assertEquals("String_Node_Str",secondMessageContent);
}