### Question:
ElasticSearchSearchIndex extends ElasticSearchSearchIndexBase { public String createJsonForElement(Graph graph, Element element, Authorizations authorizations) { try { String indexName = getIndexName(element); IndexInfo indexInfo = ensureIndexCreatedAndInitialized(indexName, getConfig().isStoreSourceData()); return buildJsonContentFromElement(graph, indexInfo, element, authorizations).string(); } catch (Exception e) { throw new SecureGraphException("Could not create JSON for element", e); } } ElasticSearchSearchIndex(GraphConfiguration config); @Override void addElement(Graph graph, Element element, Authorizations authorizations); @Override void addElementToBulkRequest(Graph graph, BulkRequest bulkRequest, IndexInfo indexInfo, Element element, Authorizations authorizations); @Override void removeElement(Graph graph, Element element, Authorizations authorizations); String createJsonForElement(Graph graph, Element element, Authorizations authorizations); @Override GraphQuery queryGraph(Graph graph, String queryString, Authorizations authorizations); @Override SearchIndexSecurityGranularity getSearchIndexSecurityGranularity();  }### Answer:
@Test public void testCreateJsonForElement() throws IOException { Metadata prop1Metadata = new Metadata(); prop1Metadata.add("metadata1", "metadata1Value", VISIBILITY_A); String expectedLargeValue = IOUtils.toString(new LargeStringInputStream(LARGE_PROPERTY_VALUE_SIZE)); PropertyValue propSmall = new StreamingPropertyValue(new ByteArrayInputStream("value1".getBytes()), String.class); PropertyValue propLarge = new StreamingPropertyValue(new ByteArrayInputStream(expectedLargeValue.getBytes()), String.class); String largePropertyName = "propLarge/\\*!@#$%^&*()[]{}|"; Vertex v1 = graph.prepareVertex("v1", VISIBILITY_A) .setProperty("propSmall", propSmall, VISIBILITY_A) .setProperty(largePropertyName, propLarge, VISIBILITY_A) .setProperty("prop1", "value1", prop1Metadata, VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); String jsonString = getSearchIndex().createJsonForElement(graph, v1, AUTHORIZATIONS_A_AND_B); JSONObject json = new JSONObject(jsonString); assertNotNull(json); getSearchIndex().loadPropertyDefinitions(); }