Program: 133449
Project: 133449
Buggy source:
/** 
 * This method checks that we can give and get valid IReaders and IWriters. 
 */
@Test public void checkAddGetReaderWriter(){
  service=new IOService();
  IReader fakeReader=new IReader(){
    @Override public Form read(    IFile file){
      return new Form();
    }
    @Override public ArrayList<Entry> findAll(    IFile file,    String regex){
      ArrayList<Entry> fakeEntry=new ArrayList<Entry>();
      return fakeEntry;
    }
    @Override public String getReaderType(){
      return "String_Node_Str";
    }
  }
;
  IWriter fakeWriter=new IWriter(){
    @Override public void write(    Form formToWrite,    IFile file){
      return;
    }
    @Override public void replace(    IFile file,    String regex,    String value){
      return;
    }
    @Override public String getWriterType(){
      return "String_Node_Str";
    }
  }
;
  assertEquals(0,service.getNumberOfReaders());
  assertEquals(0,service.getNumberOfWriters());
  service.addReader(fakeReader);
  assertNotNull(service.getReader("String_Node_Str"));
  assertTrue(fakeReader == service.getReader("String_Node_Str"));
  assertEquals(1,service.getNumberOfReaders());
  service.addReader(null);
  assertEquals(1,service.getNumberOfReaders());
  assertNull(service.getReader("String_Node_Str"));
  service.addWriter(fakeWriter);
  assertNotNull(service.getWriter("String_Node_Str"));
  assertTrue(fakeWriter == service.getWriter("String_Node_Str"));
  assertEquals(1,service.getNumberOfWriters());
  service.addWriter(null);
  assertEquals(1,service.getNumberOfWriters());
  assertNull(service.getWriter("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * This method checks that we can give and get valid IReaders and IWriters.
 */
@Test public void checkAddGetReaderWriter(){
  service=new IOService();
  IReader fakeReader=new IReader(){
    @Override public Form read(    IFile file){
      return new Form();
    }
    @Override public ArrayList<Entry> findAll(    IFile file,    String regex){
      ArrayList<Entry> fakeEntry=new ArrayList<Entry>();
      return fakeEntry;
    }
    @Override public String getReaderType(){
      return "String_Node_Str";
    }
  }
;
  IWriter fakeWriter=new IWriter(){
    @Override public void write(    Form formToWrite,    IFile file){
      return;
    }
    @Override public void replace(    IFile file,    String regex,    String value){
      return;
    }
    @Override public String getWriterType(){
      return "String_Node_Str";
    }
  }
;
  int numDefaultReaders=6;
  assertEquals(numDefaultReaders,service.getNumberOfReaders());
  int numDefaultWriters=4;
  assertEquals(numDefaultWriters,service.getNumberOfWriters());
  service.addReader(fakeReader);
  assertNotNull(service.getReader("String_Node_Str"));
  assertTrue(fakeReader == service.getReader("String_Node_Str"));
  assertEquals(numDefaultReaders + 1,service.getNumberOfReaders());
  service.addReader(null);
  assertEquals(numDefaultReaders + 1,service.getNumberOfReaders());
  assertNull(service.getReader("String_Node_Str"));
  service.addWriter(fakeWriter);
  assertNotNull(service.getWriter("String_Node_Str"));
  assertTrue(fakeWriter == service.getWriter("String_Node_Str"));
  assertEquals(numDefaultWriters + 1,service.getNumberOfWriters());
  service.addWriter(null);
  assertEquals(numDefaultWriters + 1,service.getNumberOfWriters());
  assertNull(service.getWriter("String_Node_Str"));
}