protected void introDelegatePackages(CodeWriter writer, EntityType model) throws IOException {
        Set<String> packages = new HashSet<String>();
        for (Delegate delegate : model.getDelegates()) {
            if (!delegate.getDelegateType().getPackageName().equals(model.getPackageName())) {
                packages.add(delegate.getDelegateType().getPackageName());
            }
        }
        writer.importPackages(packages.toArray(new String[0]));
    }
Create a new {@code EntitySerializer} instance

@param mappings type mappings to be used
@param keywords keywords to be used
querydsl-codegen/src/main/java/com/querydsl/codegen/DefaultEntitySerializer.java