### Question:
JsonParser { public Value parseWithOffsetInJsonPointer(String json, String offsetInJsonPointer) { return new SingleParseContext(factory, json, offsetInJsonPointer).parse(); } JsonParser(); Stream open(InputStream in); Stream openWithOffsetInJsonPointer(InputStream in, String offsetInJsonPointer); Value parse(String json); Value parseWithOffsetInJsonPointer(String json, String offsetInJsonPointer);  }### Answer:
@Test public void testParseWithPointer1() throws Exception { final JsonParser parser = new JsonParser(); final Value msgpackValue = parser.parseWithOffsetInJsonPointer("{\"a\": {\"b\": 1}}", "/a/b"); assertEquals(1, msgpackValue.asIntegerValue().asInt()); }
@Test public void testParseWithPointer2() throws Exception { final JsonParser parser = new JsonParser(); final Value msgpackValue = parser.parseWithOffsetInJsonPointer("{\"a\": [{\"b\": 1}, {\"b\": 2}]}", "/a/1/b"); assertEquals(2, msgpackValue.asIntegerValue().asInt()); }