// Path: src/main/java/com/squareup/protoparser/OptionElement.java
// public enum Kind {
//   STRING,
//   BOOLEAN,
//   NUMBER,
//   ENUM,
//   MAP,
//   LIST,
//   OPTION
// }
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static final int MAX_TAG_VALUE = (1 << 29) - 1; // 536,870,911
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static final int MIN_TAG_VALUE = 1;
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static boolean isValidTag(int value) {
//   return (value >= MIN_TAG_VALUE && value < RESERVED_TAG_VALUE_START)
//       || (value > RESERVED_TAG_VALUE_END && value <= MAX_TAG_VALUE);
// }


import com.squareup.protoparser.OptionElement.Kind;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import static com.squareup.protoparser.ProtoFile.MAX_TAG_VALUE;
import static com.squareup.protoparser.ProtoFile.MIN_TAG_VALUE;
import static com.squareup.protoparser.ProtoFile.Syntax.PROTO_2;
import static com.squareup.protoparser.ProtoFile.isValidTag;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("extend == null");
    }
    try {
      ProtoFile.builder("test.proto").addOption(null);
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("option == null");
    }
    try {
      ProtoFile.builder("test.proto").addOptions(null);
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("options == null");
    }
    try {
      ProtoFile.builder("test.proto").addOptions(Collections.<OptionElement>singleton(null));
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("option == null");
    }
  }

  @Test public void tagValueValidation() {
    assertThat(isValidTag(MIN_TAG_VALUE - 1)).isFalse(); // Less than minimum.
    assertThat(isValidTag(MIN_TAG_VALUE)).isTrue();
    assertThat(isValidTag(1234)).isTrue();
    assertThat(isValidTag(19222)).isFalse(); // Reserved range.
    assertThat(isValidTag(2319573)).isTrue();
    assertThat(isValidTag(MAX_TAG_VALUE)).isTrue();
// Path: src/main/java/com/squareup/protoparser/OptionElement.java
// public enum Kind {
//   STRING,
//   BOOLEAN,
//   NUMBER,
//   ENUM,
//   MAP,
//   LIST,
//   OPTION
// }
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static final int MAX_TAG_VALUE = (1 << 29) - 1; // 536,870,911
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static final int MIN_TAG_VALUE = 1;
// 
// Path: src/main/java/com/squareup/protoparser/ProtoFile.java
// static boolean isValidTag(int value) {
//   return (value >= MIN_TAG_VALUE && value < RESERVED_TAG_VALUE_START)
//       || (value > RESERVED_TAG_VALUE_END && value <= MAX_TAG_VALUE);
// }


// Path: src/test/java/com/squareup/protoparser/ProtoFileTest.java
import com.squareup.protoparser.OptionElement.Kind;
import java.util.Arrays;
import java.util.Collections;
import org.junit.Test;
import static com.squareup.protoparser.ProtoFile.MAX_TAG_VALUE;
import static com.squareup.protoparser.ProtoFile.MIN_TAG_VALUE;
import static com.squareup.protoparser.ProtoFile.Syntax.PROTO_2;
import static com.squareup.protoparser.ProtoFile.isValidTag;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;

    } catch (NullPointerException e) {
      assertThat(e).hasMessage("extend == null");
    }
    try {
      ProtoFile.builder("test.proto").addOption(null);
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("option == null");
    }
    try {
      ProtoFile.builder("test.proto").addOptions(null);
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("options == null");
    }
    try {
      ProtoFile.builder("test.proto").addOptions(Collections.<OptionElement>singleton(null));
      fail();
    } catch (NullPointerException e) {
      assertThat(e).hasMessage("option == null");
    }
  }

  @Test public void tagValueValidation() {
    assertThat(isValidTag(MIN_TAG_VALUE - 1)).isFalse(); // Less than minimum.
    assertThat(isValidTag(MIN_TAG_VALUE)).isTrue();
    assertThat(isValidTag(1234)).isTrue();
    assertThat(isValidTag(19222)).isFalse(); // Reserved range.
    assertThat(isValidTag(2319573)).isTrue();
    assertThat(isValidTag(MAX_TAG_VALUE)).isTrue();
    assertThat(isValidTag(MAX_TAG_VALUE + 1)).isFalse(); // Greater than maximum.