private static PsiMethod findConstructorToInsert(final PsiClass aClass) throws IncorrectOperationException {
      final PsiMethod[] constructors = aClass.getConstructors();
      if (constructors.length == 0) {
        return WriteAction.compute(() -> {
          PsiElementFactory factory = JavaPsiFacade.getInstance(aClass.getProject()).getElementFactory();
          PsiMethod newConstructor = factory.createMethodFromText("public " + aClass.getName() + "() { }", aClass);
          final PsiMethod[] psiMethods = aClass.getMethods();
          PsiMethod firstMethod = (psiMethods.length == 0) ? null : psiMethods[0];
          return (PsiMethod)aClass.addBefore(newConstructor, firstMethod);
        });
      }
      for(PsiMethod method: constructors) {
        if (method.getParameterList().isEmpty()) {
          return method;
        }
      }
      return constructors [0];
    }
private static PsiMethod findConstructorToInsert(final PsiClass aClass)