private static List<? extends GenerationInfo> filterOutAlreadyInsertedConstructors(
     PsiClass aClass, List<? extends GenerationInfo> constructors) {
   boolean alreadyExist = true;
   for (GenerationInfo constructor : constructors) {
     alreadyExist &=
         aClass.findMethodBySignature((PsiMethod) constructor.getPsiMember(), false) != null;
   }
   if (alreadyExist) {
     return Collections.emptyList();
   }
   return constructors;
 }
  private static void insertGenerationInfos(
      InsertionContext context, List<PsiGenerationInfo<PsiMethod>> infos) {
    List<PsiGenerationInfo<PsiMethod>> newInfos =
        GenerateMembersUtil.insertMembersAtOffset(
            context.getFile(), context.getStartOffset(), infos);
    if (!newInfos.isEmpty()) {
      final List<PsiElement> elements = new ArrayList<PsiElement>();
      for (GenerationInfo member : newInfos) {
        if (!(member instanceof TemplateGenerationInfo)) {
          final PsiMember psiMember = member.getPsiMember();
          if (psiMember != null) {
            elements.add(psiMember);
          }
        }
      }

      GlobalInspectionContextBase.cleanupElements(
          context.getProject(), null, elements.toArray(new PsiElement[elements.size()]));
      newInfos.get(0).positionCaret(context.getEditor(), true);
    }
  }