Program: 113117
Project: 113117
Buggy source:
@Override public Iterator<Mutation> iterator(){
  return new Iterator<Mutation>(){
    List<Entry<Key,Value>> lastEntries=new ArrayList<Entry<Key,Value>>();
    LinkedList<Mutation> pendingOutput=new LinkedList<Mutation>();
    byte[] rowID=null;
    @Override public boolean hasNext(){
      return !pendingOutput.isEmpty() || rawIt.hasNext() || !lastEntries.isEmpty();
    }
    @Override public Mutation next(){
      boolean ignoreLastEntry=false;
      if (!pendingOutput.isEmpty()) {
        return pendingOutput.removeFirst();
      }
 else       if (rawIt.hasNext()) {
        while (rawIt.hasNext()) {
          Entry<Key,Value> entry=rawIt.next();
          addEntry(lastEntries,entry);
          byte[] currentRowID=entry.getKey().getRow().getBytes();
          if (rowID == null || Arrays.equals(rowID,currentRowID)) {
            rowID=currentRowID;
            continue;
          }
 else {
            rowID=currentRowID;
            ignoreLastEntry=true;
            break;
          }
        }
      }
      int countDown=lastEntries.size();
      Iterator<Entry<Key,Value>> it=lastEntries.iterator();
      while (it.hasNext()) {
        Entry<Key,Value> lastEntry=it.next();
        countDown--;
        if (ignoreLastEntry && countDown == 0)         break;
        Mutation mutation=new Mutation(lastEntry.getKey().getRow());
        if (lastEntry.getKey().isDeleted()) {
          mutation.putDelete(lastEntry.getKey().getColumnFamily(),lastEntry.getKey().getColumnQualifier(),lastEntry.getKey().getColumnVisibilityParsed(),lastEntry.getKey().getTimestamp());
        }
 else {
          mutation.put(lastEntry.getKey().getColumnFamily(),lastEntry.getKey().getColumnQualifier(),lastEntry.getKey().getColumnVisibilityParsed(),lastEntry.getValue());
        }
        pendingOutput.addLast(mutation);
        it.remove();
      }
      return pendingOutput.removeFirst();
    }
    @Override public void remove(){
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<Mutation> iterator(){
  return new Iterator<Mutation>(){
    List<Entry<Key,Value>> lastEntries=new ArrayList<Entry<Key,Value>>();
    LinkedList<Mutation> pendingOutput=new LinkedList<Mutation>();
    byte[] rowID=null;
    @Override public boolean hasNext(){
      return !pendingOutput.isEmpty() || rawIt.hasNext() || !lastEntries.isEmpty();
    }
    @Override public Mutation next(){
      boolean ignoreLastEntry=false;
      if (!pendingOutput.isEmpty()) {
        return pendingOutput.removeFirst();
      }
 else       if (rawIt.hasNext()) {
        while (rawIt.hasNext()) {
          Entry<Key,Value> entry=rawIt.next();
          addEntry(lastEntries,entry);
          byte[] currentRowID=entry.getKey().getRow().getBytes();
          if (rowID == null || Arrays.equals(rowID,currentRowID)) {
            rowID=currentRowID;
          }
 else {
            rowID=currentRowID;
            ignoreLastEntry=true;
            break;
          }
        }
      }
      int countDown=lastEntries.size();
      Iterator<Entry<Key,Value>> it=lastEntries.iterator();
      while (it.hasNext()) {
        Entry<Key,Value> lastEntry=it.next();
        countDown--;
        if (ignoreLastEntry && countDown == 0)         break;
        Mutation mutation=new Mutation(lastEntry.getKey().getRow());
        if (lastEntry.getKey().isDeleted()) {
          mutation.putDelete(lastEntry.getKey().getColumnFamily(),lastEntry.getKey().getColumnQualifier(),lastEntry.getKey().getColumnVisibilityParsed(),lastEntry.getKey().getTimestamp());
        }
 else {
          mutation.put(lastEntry.getKey().getColumnFamily(),lastEntry.getKey().getColumnQualifier(),lastEntry.getKey().getColumnVisibilityParsed(),lastEntry.getValue());
        }
        pendingOutput.addLast(mutation);
        it.remove();
      }
      return pendingOutput.removeFirst();
    }
    @Override public void remove(){
    }
  }
;
}