Program: 113097
Project: 113097
Buggy source:
public void transform(){
  try {
    final Iterator<Entry<Key,Value>> rawIt=scanner.iterator();
    Writer writer=accumuloOperations.createWriter(tableName);
    writer.write(new Iterable<Mutation>(){
      @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(){
          }
        }
;
      }
    }
);
    writer.close();
  }
 catch (  Exception ex) {
    LOGGER.error("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
public void transform(){
  try {
    final Iterator<Entry<Key,Value>> rawIt=scanner.iterator();
    Writer writer=accumuloOperations.createWriter(tableName);
    writer.write(new Iterable<Mutation>(){
      @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(){
          }
        }
;
      }
    }
);
    writer.close();
  }
 catch (  Exception ex) {
    LOGGER.error("String_Node_Str",ex);
  }
}