void () { addMagicConstant(); @Language("JAVA") String s = """ class Bar { static void foo() { int flags = getConstant(); if (flags == <caret>) {} } @org.intellij.lang.annotations.MagicConstant(valuesFromClass = Foo.class) public native int getConstant(); } interface Foo { int FOO = 1; int BAR = 2; } """; myFixture.configureByText("a.java", s); myFixture.complete(CompletionType.SMART); myFixture.assertPreferredCompletionItems(0, "BAR", "FOO"); }