Program: 22542
Project: 22542
Buggy source:
@Override protected void setup(){
  sensorFusion.configure().mode(Mode.NDOF).accRange(AccRange.AR_16G).gyroRange(GyroRange.GR_2000DPS).commit();
  if (srcIndex == 0) {
    sensorFusion.quaternion().addRouteAsync(source -> source.stream((data,env) -> {
      LineData chartData=chart.getData();
      final Quaternion quaternion=data.value(Quaternion.class);
      chartData.addXValue(String.format(Locale.US,"String_Node_Str",sampleCount * SAMPLING_PERIOD));
      chartData.addEntry(new Entry(quaternion.w(),sampleCount),0);
      chartData.addEntry(new Entry(quaternion.x(),sampleCount),1);
      chartData.addEntry(new Entry(quaternion.y(),sampleCount),2);
      chartData.addEntry(new Entry(quaternion.z(),sampleCount),3);
      sampleCount++;
    }
)).continueWith(task -> {
      streamRoute=task.getResult();
      sensorFusion.quaternion().start();
      sensorFusion.start();
      return null;
    }
);
  }
 else {
    sensorFusion.eulerAngles().addRouteAsync(source -> source.stream((data,env) -> {
      LineData chartData=chart.getData();
      final EulerAngles angles=data.value(EulerAngles.class);
      chartData.addXValue(String.format(Locale.US,"String_Node_Str",sampleCount * SAMPLING_PERIOD));
      chartData.addEntry(new Entry(angles.heading(),sampleCount),0);
      chartData.addEntry(new Entry(angles.pitch(),sampleCount),1);
      chartData.addEntry(new Entry(angles.roll(),sampleCount),2);
      chartData.addEntry(new Entry(angles.yaw(),sampleCount),3);
      sampleCount++;
    }
)).continueWith(task -> {
      streamRoute=task.getResult();
      sensorFusion.eulerAngles().start();
      sensorFusion.start();
      return null;
    }
);
  }
}

Fixed version (ground truth):
@Override protected void setup(){
  sensorFusion.configure().mode(Mode.NDOF).accRange(AccRange.AR_16G).gyroRange(GyroRange.GR_2000DPS).commit();
  if (srcIndex == 0) {
    sensorFusion.quaternion().addRouteAsync(source -> source.stream((data,env) -> {
      LineData chartData=chart.getData();
      final Quaternion quaternion=data.value(Quaternion.class);
      chartData.addXValue(String.format(Locale.US,"String_Node_Str",sampleCount * SAMPLING_PERIOD));
      chartData.addEntry(new Entry(quaternion.w(),sampleCount),0);
      chartData.addEntry(new Entry(quaternion.x(),sampleCount),1);
      chartData.addEntry(new Entry(quaternion.y(),sampleCount),2);
      chartData.addEntry(new Entry(quaternion.z(),sampleCount),3);
      sampleCount++;
      updateChart();
    }
)).continueWith(task -> {
      streamRoute=task.getResult();
      sensorFusion.quaternion().start();
      sensorFusion.start();
      return null;
    }
);
  }
 else {
    sensorFusion.eulerAngles().addRouteAsync(source -> source.stream((data,env) -> {
      LineData chartData=chart.getData();
      final EulerAngles angles=data.value(EulerAngles.class);
      chartData.addXValue(String.format(Locale.US,"String_Node_Str",sampleCount * SAMPLING_PERIOD));
      chartData.addEntry(new Entry(angles.heading(),sampleCount),0);
      chartData.addEntry(new Entry(angles.pitch(),sampleCount),1);
      chartData.addEntry(new Entry(angles.roll(),sampleCount),2);
      chartData.addEntry(new Entry(angles.yaw(),sampleCount),3);
      sampleCount++;
      updateChart();
    }
)).continueWith(task -> {
      streamRoute=task.getResult();
      sensorFusion.eulerAngles().start();
      sensorFusion.start();
      return null;
    }
);
  }
}