CallMatcher () { PsiMethod equalsMethod = myRecordCandidate.getEqualsMethod(); PsiMethod hashCodeMethod = myRecordCandidate.getHashCodeMethod(); if (equalsMethod == null && hashCodeMethod == null) return CallMatcher.none(); List<CallMatcher> result = new SmartList<>(); Set<PsiField> fields = myRecordCandidate.getFieldAccessors().keySet(); if (EqualsChecker.isStandardEqualsMethod(equalsMethod, fields)) { result.add(OBJECT_EQUALS); } if (hashCodeMethod != null) { var hashCodeVisitor = new HashCodeVisitor(fields); hashCodeMethod.accept(hashCodeVisitor); if (hashCodeVisitor.myNonVisitedFields.isEmpty()) { result.add(OBJECT_HASHCODE); } } return CallMatcher.anyOf(result.toArray(new CallMatcher[0])); }