void () { myFixture.addClass("package foo; class Foo {public static void foo(int i){}}"); myFixture.addClass("package foo; class Bar {public static void foo(String s){}}"); JavaCodeStyleSettings settings = JavaCodeStyleSettings.getInstance(getProject()); settings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = 1; doTest("Add static import for 'foo.Foo.foo'"); }