code: private void generateClass(TreeLogger logger, GeneratorContext context) throws Throwable {
  
          // get print writer that receives the source code
          PrintWriter printWriter = context.tryCreate(logger, packageName, className);
  
          // print writer if null, source code has ALREADY been generated, return
          if (printWriter == null) { return; }
  
          // init composer, set class properties, create source writer
          ClassSourceFileComposerFactory composerFactory =
                  new ClassSourceFileComposerFactory(packageName, className);
  
          // Imports
          composerFactory.addImport("org.jboss.as.console.client.Console");
          composerFactory.addImport("org.jboss.as.console.client.ProductConfig");
  
          composerFactory.addImport("java.util.*");
  
          // Interfaces
          composerFactory.addImplementedInterface("org.jboss.as.console.client.ProductConfig");
  
          // SourceWriter
          SourceWriter sourceWriter = composerFactory.createSourceWriter(context, printWriter);
  
          // ctor
          generateConstructor(sourceWriter);
  
          // Methods
          generateMethods(logger, sourceWriter, context);
  
          // close generated class
          sourceWriter.outdent();
          sourceWriter.println("}");
  
          // commit generated class
          context.commit(logger, printWriter);
      }
docs: Generate source code for new class. Class extends
  <code>HashMap</code>.
  
  @param logger  Logger object
  @param context Generator context