public JsonPathTokenizer(final String path) {
    this.path = requireNonNull(path, "path is null");

    if (path.isEmpty()) {
      throw invalidJsonPath();
    }

    // skip the start token
    match('$');
  }
@Test
  public void testJsonPathTokenizer() {
    final JsonPathTokenizer jsonPathTokenizer = new JsonPathTokenizer("$.logs[0].cloud.region");
    final List<String> tokenList = ImmutableList.copyOf(jsonPathTokenizer);
    assertThat(tokenList.size(), is(equalTo(4)));
    assertThat(tokenList.get(0), is(equalTo("logs")));

    assertThat(tokenList.get(1), is(equalTo("0")));
    assertThat(tokenList.get(2), is(equalTo("cloud")));
    assertThat(tokenList.get(3), is(equalTo("region")));
  }