boolean (@NotNull PsiClass aClass) { final PsiMethod[] methods = aClass.findMethodsByName("writeReplace", true); for (PsiMethod method : methods) { if (isWriteReplace(method)) { return true; } } return false; }