Program: 59930
Project: 59930
Buggy source:
@Test public void f() throws ReportingException, InterruptedException {
  ReportManager rm=new ReportManager();
  RunInfo ri=new RunInfo(new Period(PeriodType.ITERATION,1000));
  ResponseTimeReporter r1=new ResponseTimeReporter();
  ResponseTimeReporter r2=new ResponseTimeReporter();
  DummyReporter dr=new DummyReporter();
  rm.registerReporter(r1);
  rm.setRunInfo(ri);
  rm.registerReporter(r2);
  Assert.assertEquals(r1.runInfo,ri);
  Assert.assertEquals(r2.runInfo,ri);
  rm.unregisterReporter(r2);
  rm.registerReporter(r1);
  Assert.assertEquals(rm.getReporters().size(),1);
  rm.registerReporter(r2);
  Assert.assertTrue(rm.getReporters().contains(r1));
  Assert.assertTrue(rm.getReporters().contains(r2));
  rm.registerReporter(dr);
  MeasurementUnit mu=null;
  for (int i=0; i <= 500; i++) {
    mu=rm.newMeasurementUnit();
  }
  Assert.assertEquals(mu.getIteration(),500);
  Assert.assertEquals(mu.getLastTime(),-1);
  Assert.assertEquals(mu.getTotalTime(),0);
  mu.startMeasure();
  Thread.sleep(500);
  mu.stopMeasure();
  Assert.assertTrue(mu.getTotalTime() < 600);
  Assert.assertTrue(mu.getLastTime() < 600);
  mu.startMeasure();
  Thread.sleep(500);
  mu.stopMeasure();
  Assert.assertTrue(mu.getTotalTime() < 1200);
  Assert.assertTrue(mu.getLastTime() < 600);
  Assert.assertEquals(ri.getPercentage(),0d);
  Assert.assertFalse(ri.isRunning());
  Assert.assertEquals(ri.getStartTime(),-1);
  Assert.assertEquals(ri.getEndTime(),-1);
  Assert.assertEquals(ri.getRunTime(),0);
  rm.report(mu);
  Assert.assertNull(dr.getLastMethod(),"String_Node_Str");
  rm.start();
  rm.report(mu);
  Assert.assertTrue(ri.isRunning());
  Assert.assertEquals(dr.getLastMethod(),"String_Node_Str");
  rm.reset();
  Assert.assertEquals(dr.getLastMethod(),"String_Node_Str");
  rm.stop();
  Assert.assertFalse(ri.isRunning());
}

Fixed version (ground truth):
@Test public void f() throws ReportingException, InterruptedException {
  ReportManager rm=new ReportManager();
  RunInfo ri=new RunInfo(new Period(PeriodType.ITERATION,1000));
  ResponseTimeReporter r1=new ResponseTimeReporter();
  ResponseTimeReporter r2=new ResponseTimeReporter();
  DummyReporter dr=new DummyReporter();
  rm.registerReporter(r1);
  rm.setRunInfo(ri);
  rm.registerReporter(r2);
  Assert.assertEquals(r1.runInfo,ri);
  Assert.assertEquals(r2.runInfo,ri);
  rm.unregisterReporter(r2);
  rm.registerReporter(r1);
  Assert.assertEquals(rm.getReporters().size(),1);
  rm.registerReporter(r2);
  Assert.assertTrue(rm.getReporters().contains(r1));
  Assert.assertTrue(rm.getReporters().contains(r2));
  rm.registerReporter(dr);
  MeasurementUnit mu=null;
  for (int i=0; i <= 500; i++) {
    mu=rm.newMeasurementUnit();
  }
  Assert.assertEquals(mu.getIteration(),500);
  Assert.assertEquals(mu.getLastTime(),-1);
  Assert.assertEquals(mu.getTotalTime(),0);
  mu.startMeasure();
  Thread.sleep(500);
  mu.stopMeasure();
  Assert.assertTrue(mu.getTotalTime() < 600);
  Assert.assertTrue(mu.getLastTime() < 600);
  mu.startMeasure();
  Thread.sleep(500);
  mu.stopMeasure();
  Assert.assertTrue(mu.getTotalTime() < 1200);
  Assert.assertTrue(mu.getLastTime() < 600);
  Assert.assertEquals(ri.getPercentage(),0d);
  Assert.assertFalse(ri.isRunning());
  Assert.assertEquals(ri.getStartTime(),-1);
  Assert.assertEquals(ri.getEndTime(),-1);
  Assert.assertEquals(ri.getRunTime(),0);
  rm.report(mu);
  Assert.assertNull(dr.getLastMethod(),"String_Node_Str");
  rm.start();
  rm.report(mu);
  long startTime=ri.getStartTime();
  Assert.assertTrue(ri.isRunning());
  Assert.assertEquals(dr.getLastMethod(),"String_Node_Str");
  rm.reset();
  Assert.assertEquals(dr.getLastMethod(),"String_Node_Str");
  rm.stop();
  Assert.assertFalse(ri.isRunning());
  DummyDestination d1=new DummyDestination();
  DummyDestination d2=new DummyDestination();
  r1.registerDestination(d1,new Period(PeriodType.ITERATION,100));
  r1.registerDestination(d2,new Period(PeriodType.PERCENTAGE,10));
  r1.registerDestination(d1,new Period(PeriodType.TIME,2000));
  Set<BoundPeriod<Destination>> bp=new HashSet<>();
  bp.add(new BoundPeriod<Destination>(PeriodType.ITERATION,100,d1));
  bp.add(new BoundPeriod<Destination>(PeriodType.PERCENTAGE,10,d2));
  bp.add(new BoundPeriod<Destination>(PeriodType.TIME,2000,d1));
  Assert.assertTrue(r1.getReportingPeriods().containsAll(bp));
  Assert.assertEquals(ri.getPercentage(),0d);
  Assert.assertFalse(ri.isRunning());
  Assert.assertEquals(ri.getStartTime(),startTime);
  Assert.assertTrue(ri.getEndTime() > ri.getStartTime());
  Assert.assertTrue(ri.getRunTime() == ri.getEndTime() - ri.getStartTime());
  rm.start();
  mu=null;
  for (int i=0; i <= 100; i++) {
    mu=rm.newMeasurementUnit();
    mu.startMeasure();
    mu.appendResult("String_Node_Str",(double)i);
    Thread.sleep(10);
    mu.stopMeasure();
    rm.report(mu);
  }
  Assert.assertEquals(mu.getIteration(),100);
  Assert.assertEquals(mu.getLastTime(),10);
  Assert.assertEquals(mu.getTotalTime(),10);
  Assert.assertEquals(d1.getLastType(),PeriodType.ITERATION);
  Assert.assertEquals(d2.getLastType(),PeriodType.PERCENTAGE);
  Thread.sleep(2500);
  Assert.assertEquals(d1.getLastType(),PeriodType.TIME);
  rm.stop();
}