@Nullable
  private PsiMethod findCompatibleConstructor(@NotNull PsiClass aClass) {
    ParameterInfoImpl[] paramsToMerge = getParamsToMerge();
    if (paramsToMerge.length == 1) {
      final ParameterInfoImpl parameterInfo = paramsToMerge[0];
      final PsiType paramType = parameterInfo.getTypeWrapper().getType(aClass);
      String fqn = aClass.getQualifiedName();
      if (fqn != null && TypeConversionUtil.isPrimitiveWrapper(fqn)) {
        ParameterBean bean = new ParameterBean();
        bean.setField(aClass.findFieldByName("value", false));
        bean.setGetter(paramType.getCanonicalText() + "Value");
        myExistingClassProperties.put(parameterInfo, bean);
        for (PsiMethod constructor : aClass.getConstructors()) {
          if (isConstructorCompatible(constructor, new ParameterInfoImpl[]{parameterInfo}, aClass)) return constructor;
        }
      }
    }
    final PsiMethod[] constructors = aClass.getConstructors();
    PsiMethod compatibleConstructor = null;
    for (PsiMethod constructor : constructors) {
      if (isConstructorCompatible(constructor, paramsToMerge, aClass)) {
        compatibleConstructor = constructor;
        break;
      }
    }

    PsiField[] fields = aClass.getFields();
    if (compatibleConstructor == null && !areTypesCompatible(getParamsToMerge(), fields, aClass)) {
      return null;
    }

    final PsiVariable[] constructorParams = compatibleConstructor != null ? compatibleConstructor.getParameterList().getParameters()
                                                                          : fields;
    for (int i = 0; i < getParamsToMerge().length; i++) {
      final int oldIndex = getParamsToMerge()[i].getOldIndex();
      final ParameterInfoImpl methodParam = getParameterInfo(oldIndex);
      final ParameterBean bean = new ParameterBean();
      myExistingClassProperties.put(methodParam, bean);

      final PsiVariable var = constructorParams[i];

      final PsiField field = var instanceof PsiParameter ? findFieldAssigned((PsiParameter)var, compatibleConstructor) : (PsiField)var;
      if (field == null) {
        return null;
      }

      bean.setField(field);

      final PsiMethod getterForField = PropertyUtilBase.findGetterForField(field);
      if (getterForField != null) {
        bean.setGetter(getterForField.getName());
      }

      final PsiMethod setterForField = PropertyUtilBase.findSetterForField(field);
      if (setterForField != null) {
        bean.setSetter(setterForField.getName());
      }
    }
    return compatibleConstructor;
  }
@Nullable
  private PsiMethod findCompatibleConstructor(@NotNull PsiClass aClass)