@Test(expected = InvalidKeyPathException.class)
public void rootNotARecord() throws InvalidKeyPathException {

  Path path = KeyPathParser.parse("$[\"a\"]");
  Schema schema = SchemaBuilder.array().items(Schema.create(Type.STRING));
  try {
    new KeyPathValidator(path, schema).validate();
  } catch (Exception e) {
    assertThat(e.getMessage(), is("Element '$' not a traversable type (found 'ARRAY'), in path: $[\"a\"]"));
    throw e;
  }
}