PsiMethod (@NotNull PsiClass aClass, @NotNull PropertyKind kind, @NotNull String propertyName, @NotNull PsiField field1) { final PsiMethod[] methods = aClass.findMethodsByName(kind.prefix + propertyName, true); for (PsiMethod method : methods) { final PsiField field2 = kind == PropertyKind.SETTER ? getFieldOfSetter(method) : getFieldOfGetter(method); if (field1.equals(field2)) { return method; } } return null; }