PsiMethod (@NotNull PsiRecordComponent component) { PsiClass aClass = component.getContainingClass(); if (aClass == null || !aClass.isRecord()) return null; for (PsiMethod method : aClass.findMethodsByName(component.getName(), false)) { if (method.getParameterList().isEmpty()) return method; } return null; }