### Question:
SirenFieldFacetExtractor implements FacetExtractor { protected void generateFacetsForLeaves(JsonNode sirenNode, String fieldName, ExtendedJsonField field, String path, List<SirenFacetEntry> facets) { if (facets == null) { throw new NullArgumentException("Parameter facets must not be null"); } if (path == null) { throw new NullArgumentException("Parameter path must not be null"); } if (sirenNode.isValueNode()) { generateFacetsForLeaves((ValueNode) sirenNode, fieldName, field, path, facets); } if (sirenNode.isArray()) { generateFacetsForLeaves((ArrayNode) sirenNode, fieldName, field, path, facets); } if (sirenNode.isObject()) { generateFacetsForLeaves((ObjectNode) sirenNode, fieldName, field, path, facets); } } SirenFieldFacetExtractor();  SirenFieldFacetExtractor(IndexSchema schema); void setSchema(IndexSchema schema); IndexSchema getSchema(); @Override List<SirenFacetEntry> extractFacets(SolrInputDocument doc);  }### Answer:
@Test public void testPathGenerating() throws JsonProcessingException, IOException { JsonNode node = mapper.readTree("{\"knows\": [{\"name\":\"josef\"}, {\"name\":\"szymon\"}]}"); List<SirenFacetEntry> list = new ArrayList<SirenFacetEntry>(); extractor.generateFacetsForLeaves(node, "FIELDNAME", null, "", list); assertEquals(2, list.size()); node = mapper.readTree("{\"knows\": [{\"name\": null}]}"); list.clear(); extractor.generateFacetsForLeaves(node, "FIELDNAME", null, "", list); assertEquals(1, list.size()); assertEquals(FacetDatatype.NULL, list.get(0).datatype); assertEquals("knows.name", list.get(0).path); assertEquals("null", list.get(0).value); node = mapper.readTree("{\"knows\": {\"name\": true}}"); list.clear(); extractor.generateFacetsForLeaves(node, "FIELDNAME", null, "", list); assertEquals(1, list.size()); assertEquals(FacetDatatype.BOOLEAN, list.get(0).datatype); assertEquals("knows.name", list.get(0).path); assertEquals(true, list.get(0).value); assertEquals("boolean.FIELDNAME.knows.name", list.get(0).toFieldName()); node = mapper.readTree("{\"knows\": {\"age\": 32}}"); list.clear(); extractor.generateFacetsForLeaves(node, "FIELDNAME", null, "", list); assertEquals(1, list.size()); assertEquals(FacetDatatype.LONG, list.get(0).datatype); assertEquals("knows.age", list.get(0).path); assertEquals(32, list.get(0).value); assertEquals("long.FIELDNAME.knows.age", list.get(0).toFieldName()); }