void () { final String in = """ class ImportTest {{ Math.abs(-0.5); Math.sin(0.5); Math.max(1, 2); }}"""; final String what = "Math.'m('_a*)"; final String by = "Math.$m$($a$)"; final boolean save = options.isToUseStaticImport(); options.setToUseStaticImport(true); try { // depends on default setting being equal to 3 for names count to use import on demand final String expected = """ import static java.lang.Math.*; class ImportTest {{ abs(-0.5); sin(0.5); max(1, 2); }}"""; assertEquals("Replacing with static star import", expected, replace(in, what, by, true, true)); } finally { options.setToUseStaticImport(save); } }