### Question:
OntologySchemaProvider implements GraphElementSchemaProvider { @Override public Iterable<GraphVertexSchema> getVertexSchemas(String label) { return Stream.ofAll(this.schemaProvider.getVertexSchemas(label)) .map(vertexSchema -> getEntitySchema(label, vertexSchema)) .filter(Optional::isPresent) .map(Optional::get) .toJavaList(); } @Inject  OntologySchemaProvider(Ontology ontology, GraphElementSchemaProvider schemaProvider); @Override Iterable<GraphVertexSchema> getVertexSchemas(String label); @Override Iterable<GraphEdgeSchema> getEdgeSchemas(String label); @Override Iterable<GraphEdgeSchema> getEdgeSchemas(String vertexLabelA, String label); @Override Iterable<GraphEdgeSchema> getEdgeSchemas(String vertexLabelA, Direction direction, String label); @Override Iterable<GraphEdgeSchema> getEdgeSchemas(String vertexLabelA, Direction direction, String label, String vertexLabelB); @Override Optional<GraphElementPropertySchema> getPropertySchema(String name); @Override Iterable<String> getVertexLabels(); @Override Iterable<String> getEdgeLabels(); @Override Iterable<String> getPropertyNames(); @Override Optional<String> getLabelFieldName();  }### Answer:
@Test public void getVertexSchema() throws Exception { Ontology ontology = getOntology(); OntologySchemaProvider ontologySchemaProvider = getOntologySchemaProvider(ontology); GraphVertexSchema vertexPersonSchema = Stream.ofAll(ontologySchemaProvider.getVertexSchemas("Person")).get(0); assertEquals(vertexPersonSchema.getConstraint().getTraversalConstraint(), __.start().has(T.label, "Person")); List<String> indices = Stream.ofAll(vertexPersonSchema.getIndexPartitions().get().getPartitions()).flatMap(IndexPartitions.Partition::getIndices).toJavaList(); assertEquals(2, indices.size()); assertEquals("vertexIndex1", Stream.ofAll(indices).get(0)); assertEquals("vertexIndex2", Stream.ofAll(indices).get(1)); }
@Test public void vertexPropertiesTest(){ Ontology ontology = getOntology(); OntologySchemaProvider ontologySchemaProvider = getOntologySchemaProvider(ontology); GraphVertexSchema person = Stream.ofAll(ontologySchemaProvider.getVertexSchemas("Person")).get(0); GraphElementPropertySchema name = person.getProperty("name").get(); Assert.assertEquals(name.getName(), "name"); }