Program: 170644
Project: 170644
Buggy source:
@Test @Ignore public void testSerializeString() throws Exception {
  final ByteBufferSerializerOutput output=new ByteBufferSerializerOutput();
  final String testString1="String_Node_Str";
  final String testString2="String_Node_Str";
  final String testString3="String_Node_Str";
  final String testString4="String_Node_Str";
  output.writeString(testString1);
  assertThat(output.getPosition()).isEqualTo(16);
  output.writeString(testString2);
  assertThat(output.getPosition()).isEqualTo(82);
  output.writeString(testString3);
  assertThat(output.getPosition()).isEqualTo(165);
  output.writeString(testString4);
  assertThat(output.getPosition()).isEqualTo(200);
  output.writeString("String_Node_Str");
  assertThat(output.getPosition()).isEqualTo(201);
  final ByteBufferSerializerInput input=new ByteBufferSerializerInput(output.getSerializedData());
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_ASCII);
  assertThat(input.readString()).isEqualTo(testString1);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString2);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString3);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString4);
  assertThat(input.readString()).isEmpty();
  final ByteBufferSerializerOutput longStringOutput=new ByteBufferSerializerOutput(new byte[32]);
  final String longString="String_Node_Str" + "String_Node_Str";
  longStringOutput.writeString(longString);
  assertThat(longStringOutput.getPosition()).isEqualTo(149);
  final ByteBufferSerializerInput longStringInput=new ByteBufferSerializerInput(longStringOutput.getSerializedData());
  assertThat(longStringInput.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_ASCII);
  assertThat(longStringInput.readString()).isEqualTo(longString);
}

Fixed version (ground truth):
@Test public void testSerializeString() throws Exception {
  final ByteBufferSerializerOutput output=new ByteBufferSerializerOutput();
  final String testString1="String_Node_Str";
  final String testString2="String_Node_Str";
  final String testString3="String_Node_Str";
  final String testString4="String_Node_Str";
  output.writeString(testString1);
  assertThat(output.getPosition()).isEqualTo(16);
  output.writeString(testString2);
  assertThat(output.getPosition()).isEqualTo(82);
  output.writeString(testString3);
  assertThat(output.getPosition()).isEqualTo(165);
  output.writeString(testString4);
  assertThat(output.getPosition()).isEqualTo(200);
  output.writeString("String_Node_Str");
  assertThat(output.getPosition()).isEqualTo(201);
  final ByteBufferSerializerInput input=new ByteBufferSerializerInput(output.getSerializedData());
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_ASCII);
  assertThat(input.readString()).isEqualTo(testString1);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString2);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString3);
  assertThat(input.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_UTF8);
  assertThat(input.readString()).isEqualTo(testString4);
  assertThat(input.readString()).isEmpty();
  final ByteBufferSerializerOutput longStringOutput=new ByteBufferSerializerOutput(new byte[32]);
  final String longString="String_Node_Str" + "String_Node_Str";
  longStringOutput.writeString(longString);
  assertThat(longStringOutput.getPosition()).isEqualTo(149);
  final ByteBufferSerializerInput longStringInput=new ByteBufferSerializerInput(longStringOutput.getSerializedData());
  assertThat(longStringInput.peekType()).isEqualTo(SerializerDefs.TYPE_STRING_ASCII);
  assertThat(longStringInput.readString()).isEqualTo(longString);
}