Program: 2123
Project: 2123
Buggy source:
@Test(groups="String_Node_Str") public void testCombiningTimelinesByteRepeats() throws Exception {
  final int firstTime=1293846;
  final int[] unencodedTimes1=new int[10];
  final int[] unencodedTimes2=new int[10];
  for (int i=0; i < 10; i++) {
    unencodedTimes1[i]=firstTime + i * 100;
    unencodedTimes2[i]=firstTime + 10 * 100 + i * 100;
  }
  final byte[] compressedTimes1=TimelineCoder.compressTimes(unencodedTimes1);
  final byte[] compressedTimes2=TimelineCoder.compressTimes(unencodedTimes2);
  Assert.assertEquals(compressedTimes1.length,8);
  Assert.assertEquals(compressedTimes1[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(compressedTimes1[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(compressedTimes1[6] & 0xff,9);
  Assert.assertEquals(compressedTimes1[7] & 0xff,100);
  Assert.assertEquals(compressedTimes2.length,8);
  Assert.assertEquals(compressedTimes2[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(compressedTimes2[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(compressedTimes2[6] & 0xff,9);
  Assert.assertEquals(compressedTimes2[7] & 0xff,100);
  final List<byte[]> timesList=new ArrayList<byte[]>();
  timesList.add(compressedTimes1);
  timesList.add(compressedTimes2);
  final byte[] combinedTimes=TimelineCoder.combineTimelines(timesList);
  Assert.assertEquals(combinedTimes.length,8);
  Assert.assertEquals(combinedTimes[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(combinedTimes[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(combinedTimes[6] & 0xff,19);
  Assert.assertEquals(combinedTimes[7] & 0xff,100);
  Assert.assertEquals(combinedTimes[6],19);
}

Fixed version (ground truth):
@Test(groups="String_Node_Str") public void testCombiningTimelinesByteRepeats() throws Exception {
  final int firstTime=1293846;
  final int[] unencodedTimes1=new int[10];
  final int[] unencodedTimes2=new int[10];
  for (int i=0; i < 10; i++) {
    unencodedTimes1[i]=firstTime + i * 100;
    unencodedTimes2[i]=firstTime + 10 * 100 + i * 100;
  }
  final byte[] compressedTimes1=TimelineCoder.compressTimes(unencodedTimes1);
  final byte[] compressedTimes2=TimelineCoder.compressTimes(unencodedTimes2);
  Assert.assertEquals(compressedTimes1.length,8);
  Assert.assertEquals(compressedTimes1[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(compressedTimes1[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(compressedTimes1[6] & 0xff,9);
  Assert.assertEquals(compressedTimes1[7] & 0xff,100);
  Assert.assertEquals(compressedTimes2.length,8);
  Assert.assertEquals(compressedTimes2[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(compressedTimes2[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(compressedTimes2[6] & 0xff,9);
  Assert.assertEquals(compressedTimes2[7] & 0xff,100);
  final List<byte[]> timesList=new ArrayList<byte[]>();
  timesList.add(compressedTimes1);
  timesList.add(compressedTimes2);
  final byte[] combinedTimes=TimelineCoder.combineTimelines(timesList);
  Assert.assertEquals(combinedTimes.length,8);
  Assert.assertEquals(combinedTimes[0] & 0xff,TimelineOpcode.FULL_TIME.getOpcodeIndex());
  Assert.assertEquals(combinedTimes[5] & 0xff,TimelineOpcode.REPEATED_DELTA_TIME_BYTE.getOpcodeIndex());
  Assert.assertEquals(combinedTimes[6] & 0xff,19);
  Assert.assertEquals(combinedTimes[7] & 0xff,100);
  Assert.assertEquals(combinedTimes[6],19);
  Assert.assertEquals(TimelineCoder.countTimeBytesSamples(combinedTimes),20);
}