code: protected final void write( String packageName, TypeSpec type, PrintWriter printWriter ) throws UnableToCompleteException {
          try {
              JavaFile.builder( packageName, type )
                      .build()
                      .writeTo( printWriter );
              context.commit( logger, printWriter );
          } catch ( IOException e ) {
              logger.log( TreeLogger.Type.ERROR, "Error writing the file " + packageName + "." + type.name, e );
              throw new UnableToCompleteException();
          }
      }
docs: Writes the given type to the {@link PrintWriter}.
  
  @param packageName the package for the type
  @param type the type
  @param printWriter the writer
  @throws com.google.gwt.core.ext.UnableToCompleteException if an exception is thrown by the writer