// Path: src/main/java/com/squareup/protoparser/DataType.java
// final class NamedType implements DataType {
//   public static NamedType create(String name) {
//     return new NamedType(checkNotNull(name, "name"));
//   }
// 
//   private final String name;
// 
//   private NamedType(String name) {
//     this.name = name;
//   }
// 
//   public String name() {
//     return name;
//   }
// 
//   @Override public Kind kind() {
//     return Kind.NAMED;
//   }
// 
//   @Override public String toString() {
//     return name;
//   }
// 
//   @Override public boolean equals(Object obj) {
//     if (obj == this) return true;
//     if (!(obj instanceof NamedType)) return false;
//     NamedType other = (NamedType) obj;
//     return name.equals(other.name);
//   }
// 
//   @Override public int hashCode() {
//     return name.hashCode();
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/OptionElement.java
// public enum Kind {
//   STRING,
//   BOOLEAN,
//   NUMBER,
//   ENUM,
//   MAP,
//   LIST,
//   OPTION
// }


import com.squareup.protoparser.DataType.NamedType;
import com.squareup.protoparser.OptionElement.Kind;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
    String expected = ""
        + "service Service {\n"
        + "  option foo = \"bar\";\n"
        + "\n"
        + "  rpc Name (RequestType) returns (ResponseType);\n"
        + "}\n";
    assertThat(service.toSchema()).isEqualTo(expected);
  }

  @Test public void addMultipleOptions() {
    OptionElement kitKat = OptionElement.create("kit", Kind.STRING, "kat");
    OptionElement fooBar = OptionElement.create("foo", Kind.STRING, "bar");
    ServiceElement service = ServiceElement.builder()
        .name("Service")
        .addOptions(Arrays.asList(kitKat, fooBar))
        .addRpc(RpcElement.builder()
            .name("Name")
            .requestType(NamedType.create("RequestType"))
            .responseType(NamedType.create("ResponseType"))
            .build())
        .build();
    assertThat(service.options()).hasSize(2);
  }

  @Test public void singleWithDocumentationToSchema() {
    ServiceElement service = ServiceElement.builder()
        .name("Service")
        .documentation("Hello")
        .addRpc(RpcElement.builder()
            .name("Name")
// Path: src/main/java/com/squareup/protoparser/DataType.java
// final class NamedType implements DataType {
//   public static NamedType create(String name) {
//     return new NamedType(checkNotNull(name, "name"));
//   }
// 
//   private final String name;
// 
//   private NamedType(String name) {
//     this.name = name;
//   }
// 
//   public String name() {
//     return name;
//   }
// 
//   @Override public Kind kind() {
//     return Kind.NAMED;
//   }
// 
//   @Override public String toString() {
//     return name;
//   }
// 
//   @Override public boolean equals(Object obj) {
//     if (obj == this) return true;
//     if (!(obj instanceof NamedType)) return false;
//     NamedType other = (NamedType) obj;
//     return name.equals(other.name);
//   }
// 
//   @Override public int hashCode() {
//     return name.hashCode();
//   }
// }
// 
// Path: src/main/java/com/squareup/protoparser/OptionElement.java
// public enum Kind {
//   STRING,
//   BOOLEAN,
//   NUMBER,
//   ENUM,
//   MAP,
//   LIST,
//   OPTION
// }


// Path: src/test/java/com/squareup/protoparser/ServiceElementTest.java
import com.squareup.protoparser.DataType.NamedType;
import com.squareup.protoparser.OptionElement.Kind;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;

    String expected = ""
        + "service Service {\n"
        + "  option foo = \"bar\";\n"
        + "\n"
        + "  rpc Name (RequestType) returns (ResponseType);\n"
        + "}\n";
    assertThat(service.toSchema()).isEqualTo(expected);
  }

  @Test public void addMultipleOptions() {
    OptionElement kitKat = OptionElement.create("kit", Kind.STRING, "kat");
    OptionElement fooBar = OptionElement.create("foo", Kind.STRING, "bar");
    ServiceElement service = ServiceElement.builder()
        .name("Service")
        .addOptions(Arrays.asList(kitKat, fooBar))
        .addRpc(RpcElement.builder()
            .name("Name")
            .requestType(NamedType.create("RequestType"))
            .responseType(NamedType.create("ResponseType"))
            .build())
        .build();
    assertThat(service.options()).hasSize(2);
  }

  @Test public void singleWithDocumentationToSchema() {
    ServiceElement service = ServiceElement.builder()
        .name("Service")
        .documentation("Hello")
        .addRpc(RpcElement.builder()
            .name("Name")
            .requestType(NamedType.create("RequestType"))