void () { PsiElement target = resolve(); assertTrue(target instanceof PsiClass); PsiMethod[] constructors = ((PsiClass)target).getConstructors(); assertEquals(1, constructors.length); PsiMethod constructor = constructors[0]; assertTrue(constructor instanceof LightRecordCanonicalConstructor); int offset = getEditor().getCaretModel().getOffset(); PsiNewExpression expr = PsiTreeUtil.findElementOfClassAtOffset(getFile(), offset, PsiNewExpression.class, false); assertEquals(constructor, expr.resolveConstructor()); }