public void convertAndCompareGedcom(File file) {

      ModelParser parser = new ModelParser();
      parser.setErrorHandler(this);
      TreeParser treeParser = new TreeParser();
      treeParser.setErrorHandler(this);
      GedcomWriter writer = new GedcomWriter();

      try {
         hasError = false;
         logWarningsErrors = false;
         Gedcom gedcom = parser.parseGedcom(file);

         File tempFile = (gedcomOut != null ? new File(gedcomOut, file.getName()) :
                 File.createTempFile(file.getName(), "tmp"));
         OutputStream out = new FileOutputStream(tempFile);

         writer.write(gedcom, out);
         if (out != null) {
            out.close();
         }

         totalGedcoms++;

         List<GedcomTag> gedcomTags = treeParser.parseGedcom(file);
         logWarningsErrors = true;
         currentFilename = tempFile.getName();
         List<GedcomTag> compareGedcomTags = treeParser.parseGedcom(tempFile);

         if (equals(gedcomTags, compareGedcomTags)) {
            equalsCount++;
         }
         else if (hasError) {
            expectedNotEqualsCount++;
         }
         else {
            logger.warn("Unexpected not equal: " + file.getName());
            unexpectedNotEqualsCount++;
         }

      } catch (SAXParseException e) {
         logger.error("SaxParseException for file: " + file.getName() + " " + e.getMessage() + " @ " + e.getLineNumber());
      } catch (IOException e) {
         logger.error("IOException for file: " + file.getName() + " " + e.getMessage());
      } catch (RuntimeException e) {
         e.printStackTrace();
         logger.error("Exception for file: " + file.getName() + " " + e.getMessage());
      }
   }