Program: 6414
Project: 6414
Buggy source:
@Test public void useTransactionTest() throws Exception {
  namespaceClient.create(new NamespaceMeta.Builder().setName(namespace).build());
  Id.DatasetInstance myTableInstance=Id.DatasetInstance.from(namespace,"String_Node_Str");
  dsFramework.addInstance("String_Node_Str",myTableInstance,DatasetProperties.EMPTY);
  final CountDownLatch receivedLatch=new CountDownLatch(1);
  Assert.assertTrue(feedManager.createFeed(FEED1));
  try {
    Cancellable cancellable=notificationService.subscribe(FEED1,new NotificationHandler<String>(){
      private int received=0;
      @Override public Type getNotificationType(){
        return String.class;
      }
      @Override public void received(      final String notification,      NotificationContext notificationContext){
        notificationContext.execute(new TxRunnable(){
          @Override public void run(          DatasetContext context) throws Exception {
            KeyValueTable table=context.getDataset("String_Node_Str");
            table.write("String_Node_Str",String.format("String_Node_Str",notification,received++));
            receivedLatch.countDown();
          }
        }
,TxRetryPolicy.maxRetries(5));
      }
    }
);
    TimeUnit.MILLISECONDS.sleep(500);
    try {
      notificationService.publish(FEED1,"String_Node_Str");
      Assert.assertTrue(receivedLatch.await(5,TimeUnit.SECONDS));
      final KeyValueTable table=dsFramework.getDataset(myTableInstance,DatasetDefinition.NO_ARGUMENTS,null);
      Assert.assertNotNull(table);
      final TransactionContext txContext=new TransactionContext(txClient,table);
      Tasks.waitFor(true,new Callable<Boolean>(){
        @Override public Boolean call() throws Exception {
          txContext.start();
          try {
            return "String_Node_Str".equals(Bytes.toString(table.read("String_Node_Str")));
          }
  finally {
            txContext.finish();
          }
        }
      }
,5,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
    }
  finally {
      cancellable.cancel();
    }
  }
  finally {
    dsFramework.deleteInstance(myTableInstance);
    feedManager.deleteFeed(FEED1);
    namespaceClient.delete(namespace);
  }
}

Fixed version (ground truth):
@Test public void useTransactionTest() throws Exception {
  namespaceClient.create(new NamespaceMeta.Builder().setName(namespace).build());
  Id.DatasetInstance myTableInstance=Id.DatasetInstance.from(namespace,"String_Node_Str");
  dsFramework.addInstance("String_Node_Str",myTableInstance,DatasetProperties.EMPTY);
  final CountDownLatch receivedLatch=new CountDownLatch(1);
  Assert.assertTrue(feedManager.createFeed(FEED1));
  try {
    Cancellable cancellable=notificationService.subscribe(FEED1,new NotificationHandler<String>(){
      private int received=0;
      @Override public Type getNotificationType(){
        return String.class;
      }
      @Override public void received(      final String notification,      NotificationContext notificationContext){
        notificationContext.execute(new TxRunnable(){
          @Override public void run(          DatasetContext context) throws Exception {
            KeyValueTable table=context.getDataset("String_Node_Str");
            table.write("String_Node_Str",String.format("String_Node_Str",notification,received++));
            receivedLatch.countDown();
          }
        }
,TxRetryPolicy.maxRetries(5));
      }
    }
);
    TimeUnit.MILLISECONDS.sleep(500);
    try {
      notificationService.publish(FEED1,"String_Node_Str");
      Assert.assertTrue(receivedLatch.await(5,TimeUnit.SECONDS));
      final KeyValueTable table=dsFramework.getDataset(myTableInstance,DatasetDefinition.NO_ARGUMENTS,null);
      Assert.assertNotNull(table);
      final TransactionContext txContext=new TransactionContext(txClient,table);
      Tasks.waitFor(true,new Callable<Boolean>(){
        @Override public Boolean call() throws Exception {
          txContext.start();
          try {
            return "String_Node_Str".equals(Bytes.toString(table.read("String_Node_Str")));
          }
  finally {
            txContext.finish();
          }
        }
      }
,5,TimeUnit.SECONDS);
    }
  finally {
      cancellable.cancel();
    }
  }
  finally {
    dsFramework.deleteInstance(myTableInstance);
    feedManager.deleteFeed(FEED1);
    namespaceClient.delete(namespace);
  }
}