void () { checkPreferredItems(0, "charAt"); myFixture.type("eq\n);\n"); assertTrue(myFixture.getEditor().getDocument().getText().contains("equals();\n")); myFixture.type("this."); myFixture.completeBasic(); assertPreferredItems(0, "someMethod"); }