gt:         for (String layer : layers) {
context: package org.codingmatters.graph.layout.attributes;
  
  import org.codingmatters.graph.layout.AttributeBuilder;
  import org.codingmatters.graph.layout.attributes.values.*;
  import org.codingmatters.graph.layout.formatting.IndentedFormatter;
  
  /**
   * Created with IntelliJ IDEA.
   * User: nelt
   * Date: 11/08/13
   * Time: 07:39
   */
  public abstract class GenericAttributesFormatter<B extends GenericAttributesFormatter<B>> 
          extends AttributeBuilder<B> 
          implements AttributesFormatter, NodeAttributes, EdgeAttributes, GraphAttributes {
  
  
      static public GenericAttributesFormatter<?> builder() {
          return new GenericAttributesFormatterImpl();
      }
  
      static private class GenericAttributesFormatterImpl extends GenericAttributesFormatter<GenericAttributesFormatterImpl> {
          @Override
          protected GenericAttributesFormatterImpl self() {
              return this;
          }
      }
      
      private final AttributeList attributes = new AttributeList();
      
      @Override
      public void append(IndentedFormatter formatter) {
          this.attributes.format(formatter);
      }
      
      public B damping(double damping) {
          this.attributes.attribute("Damping", damping);
          return this.self();
      }
      
      
      public B k(double damping) {
          this.attributes.attribute("K", damping);
          return this.self();
      }
  
      
      public B url(String url) {
          this.attributes.attribute("URL", url);
          return this.self();
      }
      
      
      public B aspect(double ratio) {
          this.attributes.attribute("aspect", ratio);
          return this.self();
      }
      
      
      public B aspect(double ratio, int passCount) {
          this.attributes.attribute("aspect", Double.toString(ratio) + ", " + passCount);
          return this.self();
      }
  
      
      public B boundingBox(long lowerLeftX, long lowerLeftY, long upperRightX, long upperRightY) {
          this.attributes.attribute("bb", String.format("%s,%s,%s,%s", lowerLeftX,lowerLeftY, upperRightX, upperRightY));
          return this.self();
      }
  
      
      public B backgroundColor(Color color) {
          this.attributes.attribute("bgcolor", color.formatted());
          return this.self();
      }
      
      public B color(Color color) {
          this.attributes.attribute("color", color.formatted());
          return this.self();
      }
      
      public B fillcolor(Color color) {
          this.attributes.attribute("fillcolor", color.formatted());
          return this.self();
      }
      
      public B fillcolor(WeightedColors weightedColors) {
          this.attributes.attribute("fillcolor", weightedColors.formatted());
          return this.self();
      }
       
      public B backgroundGradient(WeightedColors weightedColors) {
          this.attributes.attribute("bgcolor", weightedColors.formatted());
          return this.self();
      }
      
      public B shape(Shape shape) {
          this.attributes.attribute("shape", shape.formatted());
          return this.self();
      }
      
      
      public B center(boolean center) {
          this.attributes.attribute("center", center);
          return this.self();
      }
  
      
      public B center() {
          return this.center(true);
      }
      
      
      public B charset(String charset) {
          this.attributes.attribute("charset", charset);
          return this.self();
      }
  
      
      public B clusterRank(ClusterMode mode) {
          this.attributes.attribute("clusterrank", mode.formatted());
          return this.self();
      }
      
      
      public B colorScheme(String scheme) {
          this.attributes.attribute("colorscheme", scheme);
          return this.self();
      }
      
      
      public B comment(String comment) {
          this.attributes.attribute("comment", comment);
          return this.self();
      }
      
      
      public B compound(boolean compound) {
          this.attributes.attribute("compound", compound);
          return this.self();
      }
      
      public B compound() {
          this.attributes.attribute("compound", true);
          return this.self();
      }
      
      
      public B concentrate(boolean concentrate) {
          this.attributes.attribute("concentrate", concentrate);
          return this.self();
      }
      
      public B concentrate() {
          this.attributes.attribute("concentrate", true);
          return this.self();
      }
      
      
      public B defaultdist(double dist) {
          this.attributes.attribute("defaultdist", dist);
          return this.self();
      }
      
      
      public B dimension(int dim) {
          this.attributes.attribute("dim", dim);
          return this.self();
      }
      
      
      public B dpi(double dpi) {
          this.attributes.attribute("dpi", dpi);
          return this.self();
      }
      
      
      public B epsilon(double epsilon) {
          this.attributes.attribute("epsilon", epsilon);
          return this.self();
      }
      
      
      public B fontColor(Color color) {
          this.attributes.attribute("fontcolor", color.formatted());
          return this.self();
      }
      
      
      public B fontName(String font) {
          this.attributes.attribute("fontname", font);
          return this.self();
      }
      
      
      public B fontNames(String fonts) {
          this.attributes.attribute("fontnames", fonts);
          return this.self();
      }
      
      
      public B fontPath(String path) {
          this.attributes.attribute("fontpath", path);
          return this.self();
      }
      
      
      public B fontSize(double size) {
          this.attributes.attribute("fontsize", size);
          return this.self();
      }
      
      
      public B forceLabels(boolean force) {
          this.attributes.attribute("forcelabels", force);
          return this.self();
      }
      
      
      public B forceLabels() {
          return this.forceLabels(true);
      }
      
      
      public B gradientAngle(int angle) {
          this.attributes.attribute("gradientangle", angle);
          return this.self();
      }
      
      
      public B href(String href) {
          this.attributes.attribute("href", href);
          return this.self();
      }
      
      
      public B id(String id) {
          this.attributes.attribute("id", id);
          return this.self();
      }
      
      
      public B imagePath(String path) {
          this.attributes.attribute("imagepath", path);
          return this.self();
      }
  
      
      public B label(String label) {
          this.attributes.attribute("label", label);
          return this.self();
      }
      
      
      public B labelScheme(String scheme) {
          this.attributes.attribute("label_scheme", scheme);
          return this.self();
      }
      
      
      public B labelJustification(Justification justification) {
          this.attributes.attribute("labeljust", justification.formatted());
          return this.self();
      }
  
      
      public B labelLocalisation(VerticalLocalisation localisation) {
          this.attributes.attribute("labelloc", localisation.formatted());
          return this.self();
      }
  
  
      
      public B landscape(boolean landscape) {
          this.attributes.attribute("landscape", landscape);
          return this.self();
      }
  
      
      public B landscape() {
          return this.landscape(true);
      }
      
      
      public B layers(String... layers) {
          this.attributes.attribute("layers", join(layers, ":"));
          return this.self();
      }
  
      private String join(String[] layers, String separator) {
          StringBuilder result = new StringBuilder();
          boolean first = true;
  