void (ScaleContext ctx) { JBUIScale.setUserScaleFactor((float)ctx.getScale(USR_SCALE)); Font font = StartupUiUtil.getLabelFont().deriveFont(JBUIScale.scale(JBUIScale.DEF_SYSTEM_FONT_SIZE)); Graphics2D g = TestScaleHelper.createGraphics(ctx.getScale(SYS_SCALE)); double actual = EffectPainter2D.maybeScaleFontMetricsThickness_TestOnly(1, font); double expectedHighBound = PaintUtil.alignToInt(JBUIScale.getFontScale(font.getSize2D()), g, RoundingMode.ROUND_FLOOR_BIAS); double expectedLowBound = expectedHighBound / 3; Assert.assertTrue(TestScaleHelper.msg(ctx), actual >= expectedLowBound && actual <= expectedHighBound); }