// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendIndented(StringBuilder builder, String value) {
//   for (String line : value.split("\n")) {
//     builder.append("  ").append(line).append('\n');
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static <T> T checkNotNull(T value, String name) {
//   if (value == null) {
//     throw new NullPointerException(name + " == null");
//   }
//   return value;
// }


import com.google.auto.value.AutoValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static com.squareup.protoparser.Utils.appendIndented;
import static com.squareup.protoparser.Utils.checkNotNull;
import static java.util.Collections.unmodifiableMap;
        map.put(name, value);
      } else if (value instanceof OptionElement) {
        Map<String, Object> newMap = optionsAsMap(Collections.singletonList((OptionElement) value));

        Object oldValue = map.get(name);
        if (oldValue instanceof Map) {
          Map<String, Object> oldMap = (Map<String, Object>) oldValue;
          // Existing nested maps are immutable. Make a mutable copy, update, and replace.
          oldMap = new LinkedHashMap<>(oldMap);
          oldMap.putAll(newMap);
          map.put(name, oldMap);
        } else {
          map.put(name, newMap);
        }
      } else if (value instanceof Map) {
        Object oldValue = map.get(name);
        if (oldValue instanceof Map) {
          ((Map<String, Object>) oldValue).putAll((Map<String, Object>) value);
        } else {
          map.put(name, value);
        }
      } else {
        throw new AssertionError("Option value must be String, Option, List, or Map<String, ?>");
      }
    }
    return unmodifiableMap(map);
  }

  /** Return the option with the specified name from the supplied list or null. */
  public static OptionElement findByName(List<OptionElement> options, String name) {
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static void appendIndented(StringBuilder builder, String value) {
//   for (String line : value.split("\n")) {
//     builder.append("  ").append(line).append('\n');
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static <T> T checkNotNull(T value, String name) {
//   if (value == null) {
//     throw new NullPointerException(name + " == null");
//   }
//   return value;
// }


// Path: src/main/java/com/squareup/protoparser/OptionElement.java
import com.google.auto.value.AutoValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static com.squareup.protoparser.Utils.appendIndented;
import static com.squareup.protoparser.Utils.checkNotNull;
import static java.util.Collections.unmodifiableMap;

        map.put(name, value);
      } else if (value instanceof OptionElement) {
        Map<String, Object> newMap = optionsAsMap(Collections.singletonList((OptionElement) value));

        Object oldValue = map.get(name);
        if (oldValue instanceof Map) {
          Map<String, Object> oldMap = (Map<String, Object>) oldValue;
          // Existing nested maps are immutable. Make a mutable copy, update, and replace.
          oldMap = new LinkedHashMap<>(oldMap);
          oldMap.putAll(newMap);
          map.put(name, oldMap);
        } else {
          map.put(name, newMap);
        }
      } else if (value instanceof Map) {
        Object oldValue = map.get(name);
        if (oldValue instanceof Map) {
          ((Map<String, Object>) oldValue).putAll((Map<String, Object>) value);
        } else {
          map.put(name, value);
        }
      } else {
        throw new AssertionError("Option value must be String, Option, List, or Map<String, ?>");
      }
    }
    return unmodifiableMap(map);
  }

  /** Return the option with the specified name from the supplied list or null. */
  public static OptionElement findByName(List<OptionElement> options, String name) {
    checkNotNull(options, "options");