Program: 61777
Project: 61777
Buggy source:
public void start(Group group,ContentKey startingKey){
  lastQueryTime=startingKey.getTime();
  channel=ChannelNameUtils.extractFromChannelUrl(group.getChannelUrl());
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str" + group.getName() + "String_Node_Str").build();
  ExecutorService executorService=Executors.newSingleThreadExecutor(factory);
  executorService.submit(new Runnable(){
    @Override public void run(){
      try {
        doWork();
      }
 catch (      Exception e) {
        logger.warn("String_Node_Str" + channel,e);
      }
    }
    private void doWork(){
      while (!shouldExit.get()) {
        DateTime latestStableInChannel=getLatestStable();
        logger.trace("String_Node_Str",channel,lastQueryTime,latestStableInChannel);
        if (lastQueryTime.isBefore(latestStableInChannel)) {
          TimeUtil.Unit unit=getStepUnit(latestStableInChannel);
          logger.trace("String_Node_Str",channel,unit,lastQueryTime);
          TimeQuery query=TimeQuery.builder().channelName(channel).startTime(lastQueryTime).unit(unit).build();
          query.trace(false);
          addKeys(channelService.queryByTime(query));
          lastQueryTime=lastQueryTime.plus(unit.getDuration());
        }
 else {
          Sleeper.sleep(1000);
        }
      }
    }
    private void addKeys(    Collection<ContentKey> keys){
      logger.trace("String_Node_Str",channel,keys);
      try {
        for (        ContentKey key : keys) {
          if (key.compareTo(startingKey) > 0) {
            queue.put(key);
          }
        }
      }
 catch (      InterruptedException e) {
        logger.info("String_Node_Str" + e.getMessage());
        throw new RuntimeInterruptedException(e);
      }
    }
  }
);
}

Fixed version (ground truth):
public void start(Group group,ContentKey startingKey){
  lastQueryTime=startingKey.getTime();
  channel=ChannelNameUtils.extractFromChannelUrl(group.getChannelUrl());
  ThreadFactory factory=new ThreadFactoryBuilder().setNameFormat("String_Node_Str" + group.getName() + "String_Node_Str").build();
  ExecutorService executorService=Executors.newSingleThreadExecutor(factory);
  executorService.submit(new Runnable(){
    ContentKey lastAdded=startingKey;
    @Override public void run(){
      try {
        doWork();
      }
 catch (      Exception e) {
        logger.warn("String_Node_Str" + channel,e);
      }
    }
    private void doWork(){
      while (!shouldExit.get()) {
        DateTime latestStableInChannel=getLatestStable();
        logger.trace("String_Node_Str",channel,lastQueryTime,latestStableInChannel);
        if (lastQueryTime.isBefore(latestStableInChannel)) {
          TimeUtil.Unit unit=getStepUnit(latestStableInChannel);
          logger.trace("String_Node_Str",channel,unit,lastQueryTime);
          Location location=Location.ALL;
          if (unit.equals(TimeUtil.Unit.SECONDS)) {
            location=Location.CACHE;
          }
          TimeQuery query=TimeQuery.builder().channelName(channel).startTime(lastQueryTime).unit(unit).location(location).build();
          query.trace(false);
          addKeys(channelService.queryByTime(query));
          lastQueryTime=lastQueryTime.plus(unit.getDuration());
        }
 else {
          Sleeper.sleep(1000);
        }
      }
    }
    private void addKeys(    Collection<ContentKey> keys){
      logger.trace("String_Node_Str",channel,keys);
      try {
        for (        ContentKey key : keys) {
          if (key.compareTo(lastAdded) > 0) {
            queue.put(key);
            lastAdded=key;
          }
        }
      }
 catch (      InterruptedException e) {
        logger.info("String_Node_Str" + e.getMessage());
        throw new RuntimeInterruptedException(e);
      }
    }
  }
);
}