Collection<PsiMethod> (@NotNull PsiClass psiClass, @PsiModifier.ModifierConstant @NotNull String methodModifier, @NotNull PsiAnnotation psiAnnotation, boolean useJavaDefaults, @NotNull Collection<PsiField> params, @Nullable String staticName, boolean skipConstructorIfAnyConstructorExists) { List<PsiMethod> methods = new ArrayList<>(); boolean hasStaticConstructor = !validateIsStaticConstructorNotDefined(psiClass, staticName, params, new ProblemProcessingSink()); final boolean staticConstructorRequired = isStaticConstructor(staticName); final String constructorVisibility = staticConstructorRequired || psiClass.isEnum() ? PsiModifier.PRIVATE : methodModifier; // check, if we should skip verification for presence of any (not Tolerated) constructors if (!skipConstructorIfAnyConstructorExists || !isAnyConstructorDefined(psiClass)) { boolean hasConstructor = !validateIsConstructorNotDefined(psiClass, useJavaDefaults ? Collections.emptyList() : params, new ProblemProcessingSink()); if (!hasConstructor) { final PsiMethod constructor = createConstructor(psiClass, constructorVisibility, useJavaDefaults, params, psiAnnotation); methods.add(constructor); } } if (staticConstructorRequired && !hasStaticConstructor) { PsiMethod staticConstructor = createStaticConstructor(psiClass, methodModifier, staticName, useJavaDefaults, params, psiAnnotation); methods.add(staticConstructor); } return methods; }