Program: 184267
Project: 184267
Buggy source:
@Override protected void paintAnnotations(Graphics2D g2){
  if (sim == null)   return;
  double minSpeed=sim.getMinSpeedInInsideLane();
  g2.drawString(String.format("String_Node_Str",minSpeed,sim.getTime() / 60),30,50);
  Rectangle2D uBounds=getURoad().getBoundsMeters();
  g2.setFont(UI.BODY_FONT.deriveFont(24f));
  String template=getFlowString(99999.0 / 3600.0);
  Rectangle2D textRect=g2.getFontMetrics().getStringBounds(template,g2);
  AffineTransform tx=g2.getTransform();
  Point2D.Double ptIn=new Point2D.Double(uBounds.getMaxX(),uBounds.getMinY() + 2 * LANEWIDTH_M);
  metersToPixels.transform(ptIn,ptIn);
  Arrow leftArrow=new Arrow(textRect,true);
  ptIn.x-=leftArrow.wBody;
  ptIn.y-=leftArrow.yTop - ARROW_PAD;
  g2.translate(ptIn.x,ptIn.y);
  g2.setColor(UI.PURPLE);
  g2.fill(leftArrow.path);
  g2.setColor(Color.WHITE);
  g2.drawString(getFlowString(sim.qIn),0f,0f);
  g2.setTransform(tx);
  Point2D.Double ptRamp=new Point2D.Double(uBounds.getMinX(),uBounds.getMaxY() + LANEWIDTH_M);
  String qRampString=getFlowString(sim.qRamp);
  Rectangle2D qRampRect=g2.getFontMetrics().getStringBounds(qRampString,g2);
  Arrow rightArrow=new Arrow(textRect,false);
  metersToPixels.transform(ptRamp,ptRamp);
  ptRamp.y-=rightArrow.yTop;
  g2.translate(ptRamp.x,ptRamp.y);
  g2.setColor(UI.GREEN_HIGHLIGHT);
  g2.fill(rightArrow.path);
  g2.translate(textRect.getWidth() - qRampRect.getWidth(),0);
  g2.setColor(Color.BLACK);
  g2.drawString(qRampString,0f,0f);
  g2.setTransform(tx);
  Point2D.Double ptOut=new Point2D.Double(uBounds.getMaxX(),uBounds.getMaxY() - 2 * LANEWIDTH_M);
  String qOutString=getFlowString(sim.getMeanFlowOut());
  Rectangle2D qOutRect=g2.getFontMetrics().getStringBounds(qOutString,g2);
  metersToPixels.transform(ptOut,ptOut);
  ptOut.x-=rightArrow.wBody + rightArrow.wHead;
  ptOut.y-=rightArrow.yBot + ARROW_PAD;
  g2.translate(ptOut.x,ptOut.y);
  g2.setColor(UI.DARK_RED);
  g2.fill(rightArrow.path);
  g2.translate(textRect.getWidth() - qOutRect.getWidth(),0);
  g2.setColor(Color.WHITE);
  g2.drawString(qOutString,0f,0f);
  g2.setTransform(tx);
}

Fixed version (ground truth):
@Override protected void paintAnnotations(Graphics2D g2){
  if (sim == null)   return;
  Rectangle2D uBounds=getURoad().getBoundsMeters();
  g2.setFont(UI.BODY_FONT.deriveFont(24f));
  String template=getFlowString(99999.0 / 3600.0);
  Rectangle2D textRect=g2.getFontMetrics().getStringBounds(template,g2);
  AffineTransform tx=g2.getTransform();
  Point2D.Double ptIn=new Point2D.Double(uBounds.getMaxX(),uBounds.getMinY() + 2 * LANEWIDTH_M);
  metersToPixels.transform(ptIn,ptIn);
  Arrow leftArrow=new Arrow(textRect,true);
  ptIn.x-=leftArrow.wBody;
  ptIn.y-=leftArrow.yTop - ARROW_PAD;
  g2.translate(ptIn.x,ptIn.y);
  g2.setColor(UI.PURPLE);
  g2.fill(leftArrow.path);
  g2.setColor(Color.WHITE);
  g2.drawString(getFlowString(sim.qIn),0f,0f);
  g2.setTransform(tx);
  Point2D.Double ptRamp=new Point2D.Double(uBounds.getMinX(),uBounds.getMaxY() + LANEWIDTH_M);
  String qRampString=getFlowString(sim.qRamp);
  Rectangle2D qRampRect=g2.getFontMetrics().getStringBounds(qRampString,g2);
  Arrow rightArrow=new Arrow(textRect,false);
  metersToPixels.transform(ptRamp,ptRamp);
  ptRamp.y-=rightArrow.yTop;
  g2.translate(ptRamp.x,ptRamp.y);
  g2.setColor(UI.GREEN_HIGHLIGHT);
  g2.fill(rightArrow.path);
  g2.translate(textRect.getWidth() - qRampRect.getWidth(),0);
  g2.setColor(Color.BLACK);
  g2.drawString(qRampString,0f,0f);
  g2.setTransform(tx);
  Point2D.Double ptOut=new Point2D.Double(uBounds.getMaxX(),uBounds.getMaxY() - 2 * LANEWIDTH_M);
  String qOutString=getFlowString(sim.getMeanFlowOut());
  Rectangle2D qOutRect=g2.getFontMetrics().getStringBounds(qOutString,g2);
  metersToPixels.transform(ptOut,ptOut);
  ptOut.x-=rightArrow.wBody + rightArrow.wHead;
  ptOut.y-=rightArrow.yBot + ARROW_PAD;
  g2.translate(ptOut.x,ptOut.y);
  g2.setColor(UI.DARK_RED);
  g2.fill(rightArrow.path);
  g2.translate(textRect.getWidth() - qOutRect.getWidth(),0);
  g2.setColor(Color.WHITE);
  g2.drawString(qOutString,0f,0f);
  g2.setTransform(tx);
}