void () { ServiceContainerUtil.registerExtension(ApplicationManager.getApplication(), PsiAugmentProvider.EP_NAME, new PsiAugmentProvider() { @Override protected <Psi extends PsiElement> @NotNull List<Psi> getAugments(@NotNull PsiElement element, @NotNull Class<Psi> type, @Nullable String nameHint) { if (element instanceof PsiExtensibleClass eClass && eClass.getName().equals("A") && type == PsiMethod.class) { PsiMethod method1 = new LightMethodBuilder(getPsiManager(), "default").setMethodReturnType(PsiTypes.voidType()); PsiMethod method2 = new LightMethodBuilder(getPsiManager(), "define").setMethodReturnType(PsiTypes.voidType()); return List.of(type.cast(method1), type.cast(method2)); } return Collections.emptyList(); } }, getTestRootDisposable()); myFixture.configureByText("A.java", "class A {\n public void test() {\n Runnable r = A::def<caret>\n }\n}"); myFixture.completeBasic(); myFixture.checkResult(""" class A { public void test() { Runnable r = A::define; } }"""); }