void () { UISettings uiSettings = UISettings.getInstance(); String fontFace = uiSettings.getFontFace(); int fontSize = UISettings.getInstance().getFontSize(); LafManagerImpl lafManager = EdtTestUtil.runInEdtAndGet(() -> LafManagerImpl.Companion.getTestInstance()); try { String newFontName = "Arial"; int newFontSize = 17; uiSettings.setFontFace(newFontName); uiSettings.setFontSize(newFontSize); NotRoamableUiSettings.Companion.getInstance().setOverrideLafFonts(true); lafManager.updateUI(); Font font = UIManager.getFont("Label.font"); assertThat(font.getName()).describedAs("Font name is not changed").isEqualTo(newFontName); assertThat(font.getSize()).describedAs("Font size is not changed").isEqualTo(newFontSize); } finally { NotRoamableUiSettings.Companion.getInstance().setOverrideLafFonts(false); uiSettings.setFontFace(fontFace); uiSettings.setFontSize(fontSize); lafManager.updateUI(); } }