private static void collectAvailableFields(PsiClass clazz,
                                               PsiElement place,
                                               boolean includeSuperClass,
                                               FilterPattern pattern,
                                               List<? super PsiField> availableFields,
                                               HashSet<? super PsiClass> visited) {

        int sortElements = GenerateToStringContext.getConfig().getSortElements();

        if (includeSuperClass && sortElements == 3) {
            PsiClass superClass = clazz.getSuperClass();
            if (superClass != null && visited.add(superClass)) {
                collectAvailableFields(superClass, place, true, pattern, availableFields, visited);
            }
        }

        // performs til filtering process
        PsiField[] fields = includeSuperClass && sortElements != 3 ? clazz.getAllFields() : clazz.getFields();
        for (PsiField field : fields) {
            if (!JavaResolveUtil.isAccessible(field, field.getContainingClass(), field.getModifierList(), place, null, null)) {
                continue;
            }
            // if the field matches the pattern then it shouldn't be in the list of available fields
            if (!pattern.fieldMatches(field)) {
                availableFields.add(field);
            }
        }
    }
private static void collectAvailableFields(PsiClass clazz,
                                               PsiElement place,
                                               boolean includeSuperClass,
                                               FilterPattern pattern,
                                               List<? super PsiField> availableFields,
                                               HashSet<? super PsiClass> visited)