void () { addMagicConstant(); myFixture.configureByText("a.java", """ class Bar { static void foo() { if (getConstant() == <caret>) {} } @org.intellij.lang.annotations.MagicConstant(flagsFromClass = Foo.class) public native int getConstant(); } interface Foo { int FOO = 1; int BAR = 2; } """); myFixture.complete(CompletionType.SMART); myFixture.assertPreferredCompletionItems(0, "BAR", "FOO"); LookupManager.getInstance(getProject()).hideActiveLookup(); myFixture.complete(CompletionType.BASIC); myFixture.assertPreferredCompletionItems(0, "BAR", "FOO"); }