anchor.diff:      }
     }
   
  +  String _getAsTypeMethodName(TypeDecl typeDecl) {
  +    String name = javaType(typeDecl);
  +    if (name == 'String') {
  +      return 'getAsString';
  +    } else if (name == 'Boolean') {
  +      return 'getAsBoolean';
  +    } else if (name == 'Integer') {
  +      return 'getAsInt';
  +    } else if (name.startsWith('List')) {
  +      return 'getAsJsonArray';
  +    } else {
  +      // TODO (jwren) cleanup
  +      return 'getAsJsonArray';
  +    }
  +  }
  +
     String _toStringForField(TypeObjectField field) {
       String name = javaName(field.name);
       if (isArray(field.type) || isList(field.type)) {
  
positive.code:           writeln('}');
          });
        }
  
        //
        // toJson() method, example:
  
negative.code:     writeln('import java.util.Arrays;');
      writeln('import java.util.List;');
      writeln('import java.util.Map;');
      writeln('import com.google.common.collect.Lists;');
      writeln('import com.google.dart.server.utilities.general.JsonUtilities;');
      writeln('import com.google.dart.server.utilities.general.ObjectUtilities;');
      writeln('import com.google.gson.JsonArray;');
      writeln('import com.google.gson.JsonElement;');
      writeln('import com.google.gson.JsonObject;');
      writeln('import com.google.gson.JsonPrimitive;');
      writeln('import java.util.ArrayList;');
      writeln('import java.util.Iterator;');
      writeln('import org.apache.commons.lang3.StringUtils;');
      writeln();
      javadocComment(toHtmlVisitor.collectHtml(() {
  