void () { configureFromFileText("Test.java", """ import lombok.experimental.ExtensionMethod; @ExtensionMethod({Extensions.class}) public class ExtensionMethodDfa { public String test() { String iAmNull = "hELlO, WORlD!".toTitle<caret>Case(); } } class Extensions { public static String toTitleCase(String in) { if (in.isEmpty()) return in; return "" + Character.toTitleCase(in.charAt(0)) + in.substring(1).toLowerCase(Locale.ROOT); } } """); PsiElement element = GotoDeclarationAction.findTargetElement(getProject(), getEditor(), getEditor().getCaretModel().getOffset()); assertTrue(element instanceof PsiMethod); assertEquals("Extensions", ((PsiMethod)element).getContainingClass().getQualifiedName()); }