### Question:
JsonpParser extends ContentParserBase implements ContentParser<String> { @Override public ParseResults parse(String json) throws BagriException { try (Reader reader = new StringReader(json)) { return parse(reader); } catch (IOException ex) { throw new BagriException(ex, BagriException.ecInOut); } } JsonpParser(ModelManagement model); static ParseResults parseDocument(ModelManagement model, String json); @Override void init(Properties properties); @Override ParseResults parse(String json); @Override ParseResults parse(File file); @Override ParseResults parse(InputStream stream); @Override ParseResults parse(Reader reader); ParseResults parse(JsonParser parser);  }### Answer:
@Test public void testParse() throws Exception { ModelManagement dict = new ModelManagementImpl(); JsonpParser parser = new JsonpParser(dict); ParseResults results = parser.parse(json); int length = results.getContentLength(); assertTrue(length > 0); List<Data> elts = results.getResults(); assertNotNull(elts); assertEquals(18, elts.size()); Data data = elts.get(0); assertEquals("/", data.getPath()); assertNull(data.getValue()); data = elts.get(1); assertEquals("/firstName", data.getPath()); assertEquals("John", data.getValue()); data = elts.get(2); assertEquals("/lastName", data.getPath()); assertEquals("Smith", data.getValue()); }
@Test public void testParseSecurity() throws Exception { ModelManagement model = new ModelManagementImpl(); JsonpParser parser = new JsonpParser(model); File f = new File("../etc/samples/json/security1500.json"); ParseResults results = parser.parse(f); List<Data> data = results.getResults(); assertNotNull(data); assertEquals(45, data.size()); FileReader fr = new FileReader("../etc/samples/json/security5621.json"); results = parser.parse(fr); data = results.getResults(); assertNotNull(data); assertEquals(44, data.size()); InputStream fis = new FileInputStream("../etc/samples/json/security9012.json"); results = parser.parse(fis); data = results.getResults(); assertNotNull(data); assertEquals(56, data.size()); }