code: private CourierImportDeclarations addNthImport(CourierImportDeclaration importDecl) {
      CourierTopLevel root = getRoot();
      CourierImportDeclarations importDecls = root.getImportDeclarations();
      if (importDecl.getFullname() == null) {
        return importDecls;
      }
  
      boolean added = false;
      for (CourierImportDeclaration existing : importDecls.getImportDeclarationList()) {
        if (existing.getFullname() != null && importDecl.getFullname().toString().compareTo(existing.getFullname().toString()) < 0) {
          importDecls.addBefore(importDecl, existing);
          added = true;
          break;
        }
      }
      if (!added) {
        importDecls.add(importDecl);
      }
      return importDecls;
    }
docs: Add an import to an existing import list, attempting to keep the list sorted.
  
  Note: this does not change the sort order of the existing import list.  It only attempts
  to keep the list sorted if it already is by adding the import at the correct position.