// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static Set<String> calculateImports(
//         Set<FullyQualifiedJavaType> importedTypes) {
//     StringBuilder sb = new StringBuilder();
//     Set<String> importStrings = new TreeSet<String>();
//     for (FullyQualifiedJavaType fqjt : importedTypes) {
//         for (String importString : fqjt.getImportList()) {
//             sb.setLength(0);
//             sb.append("import "); //$NON-NLS-1$
//             sb.append(importString);
//             sb.append(';');
//             importStrings.add(sb.toString());
//         }
//     }
// 
//     return importStrings;
// }
// 
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static void newLine(StringBuilder sb) {
//     sb.append(lineSeparator);
// }


import static org.mybatis.generator.api.dom.OutputUtilities.calculateImports;
import static org.mybatis.generator.api.dom.OutputUtilities.newLine;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

    public TopLevelClass(String typeName) {
        this(new FullyQualifiedJavaType(typeName));
    }

    /**
     * @return Returns the importedTypes.
     */
    public Set<FullyQualifiedJavaType> getImportedTypes() {
        return Collections.unmodifiableSet(importedTypes);
    }

    public void addImportedType(String importedType) {
        addImportedType(new FullyQualifiedJavaType(importedType));
    }
    
    public void addImportedType(FullyQualifiedJavaType importedType) {
        if (importedType != null
                && importedType.isExplicitlyImported()
                && !importedType.getPackageName().equals(
                        getType().getPackageName())) {
            importedTypes.add(importedType);
        }
    }

    public String getFormattedContent() {
        StringBuilder sb = new StringBuilder();

        for (String fileCommentLine : fileCommentLines) {
            sb.append(fileCommentLine);
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static Set<String> calculateImports(
//         Set<FullyQualifiedJavaType> importedTypes) {
//     StringBuilder sb = new StringBuilder();
//     Set<String> importStrings = new TreeSet<String>();
//     for (FullyQualifiedJavaType fqjt : importedTypes) {
//         for (String importString : fqjt.getImportList()) {
//             sb.setLength(0);
//             sb.append("import "); //$NON-NLS-1$
//             sb.append(importString);
//             sb.append(';');
//             importStrings.add(sb.toString());
//         }
//     }
// 
//     return importStrings;
// }
// 
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static void newLine(StringBuilder sb) {
//     sb.append(lineSeparator);
// }


// Path: src/main/java/org/mybatis/generator/api/dom/java/TopLevelClass.java
import static org.mybatis.generator.api.dom.OutputUtilities.calculateImports;
import static org.mybatis.generator.api.dom.OutputUtilities.newLine;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;


    public TopLevelClass(String typeName) {
        this(new FullyQualifiedJavaType(typeName));
    }

    /**
     * @return Returns the importedTypes.
     */
    public Set<FullyQualifiedJavaType> getImportedTypes() {
        return Collections.unmodifiableSet(importedTypes);
    }

    public void addImportedType(String importedType) {
        addImportedType(new FullyQualifiedJavaType(importedType));
    }
    
    public void addImportedType(FullyQualifiedJavaType importedType) {
        if (importedType != null
                && importedType.isExplicitlyImported()
                && !importedType.getPackageName().equals(
                        getType().getPackageName())) {
            importedTypes.add(importedType);
        }
    }

    public String getFormattedContent() {
        StringBuilder sb = new StringBuilder();

        for (String fileCommentLine : fileCommentLines) {
            sb.append(fileCommentLine);
            newLine(sb);