@@ -0,0 +1,2270 @@
+package org.inferred.freebuilder.processor.util;%0A%0Aimport static java.util.Arrays.asList;%0A%0Aimport com.google.common.collect.ImmutableList;%0A%0Aimport java.util.List;%0A%0Apublic class Excerpts %7B%0A%0A  private static final class AddingExcerpt extends ValueType implements Excerpt %7B%0A    private final String fmt;%0A    private final Object%5B%5D args;%0A%0A    private AddingExcerpt(String fmt, Object%5B%5D args) %7B%0A      this.args = args;%0A      this.fmt = fmt;%0A    %7D%0A%0A    @Override%0A    public void addTo(SourceBuilder source) %7B%0A      source.add(fmt, args);%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A      StringBuilder result = new StringBuilder()%0A          .append(%22Excerpts.add(%5C%22%22)%0A          .append(fmt.replaceAll(%22%5B%5C%5C%5C%22%5D%22, %22%5C%5C%5C1%22))%0A          .append('%22');%0A      for (Object arg : args) %7B%0A        result.append(%22, %22).append(arg);%0A      %7D%0A      result.append(%22)%22);%0A      return result.toString();%0A    %7D%0A%0A    @Override%0A    protected void addFields(FieldReceiver fields) %7B%0A      fields.add(%22fmt%22, fmt);%0A      fields.add(%22args%22, asList(args));%0A    %7D%0A  %7D%0A%0A  public static Excerpt add(final String fmt, final Object... args) %7B%0A    return new AddingExcerpt(fmt, args);%0A  %7D%0A%0A  private static final class EmptyExcerpt implements Excerpt %7B%0A    @Override%0A    public void addTo(SourceBuilder source) %7B%7D%0A  %7D%0A%0A  private static final Excerpt EMPTY = new EmptyExcerpt();%0A%0A  public static Excerpt empty() %7B%0A    return EMPTY;%0A  %7D%0A%0A  private static final class JoiningExcerpt extends ValueType implements Excerpt %7B%0A    private final String separator;%0A    private final List%3C?%3E excerpts;%0A%0A    private JoiningExcerpt(String separator, Iterable%3C?%3E excerpts) %7B%0A      this.separator = separator;%0A      this.excerpts = ImmutableList.copyOf(excerpts);%0A    %7D%0A%0A    @Override%0A    public void addTo(SourceBuilder source) %7B%0A      String itemPrefix = %22%22;%0A      for (Object object : excerpts) %7B%0A        source.add(%22%25s%25s%22, itemPrefix, object);%0A        itemPrefix = separator;%0A      %7D%0A    %7D%0A%0A    @Override%0A    protected void addFields(FieldReceiver fields) %7B%0A      fields.add(%22separator%22, separator);%0A      fields.add(%22excerpts%22, excerpts);%0A    %7D%0A  %7D%0A%0A  public static Object join(final String separator, final Iterable%3C?%3E excerpts) %7B%0A    return new JoiningExcerpt(separator, excerpts);%0A  %7D%0A%0A  private Excerpts() %7B%7D%0A%7D%0A

Add utility type Excerpts