@Test
public void invalidArrayIndex() {

    try {
        singleElemArrayState().childFor("key");
        fail("did not throw exception");
    } catch (SchemaException e) {
        SchemaException expected = new SchemaException("#", "[key] is not an array index");
        assertEquals(expected, e);
    }
}