### Question:
VocabularyNeo4jImpl implements Vocabulary { @Override public Optional<Concept> getConceptFromId(Query query) { String idQuery = StringUtils.strip(query.getInput(), "\""); idQuery = curieUtil.getIri(idQuery).orElse(idQuery); try (Transaction tx = graph.beginTx()) { Node node = graph.index().getNodeAutoIndexer().getAutoIndex().get(CommonProperties.IRI, idQuery) .getSingle(); tx.success(); Concept concept = null; if (null != node) { concept = transformer.apply(node); } return Optional.ofNullable(concept); } } @Inject  VocabularyNeo4jImpl(GraphDatabaseService graph,
      @Nullable @IndicatesNeo4jGraphLocation String neo4jLocation, CurieUtil curieUtil,
      NodeTransformer transformer); @Override Optional<Concept> getConceptFromId(Query query); @Override List<Concept> getConceptsFromPrefix(Query query); @Override List<Concept> searchConcepts(Query query); @Override List<Concept> getConceptsFromTerm(Query query); @Override Set<String> getAllCategories(); @Override Set<String> getAllCuriePrefixes(); @Override List<String> getSuggestions(String query);  }### Answer:
@Test public void testGetByUri() { Query query = new Vocabulary.Query.Builder("http: assertThat(vocabulary.getConceptFromId(query).get(), is(hippocampus)); }
@Test public void testAbsentUri() { Query query = new Vocabulary.Query.Builder("http: assertThat(vocabulary.getConceptFromId(query).isPresent(), is(false)); }
@Test public void testQuotedIdQuery() { Query query = new Vocabulary.Query.Builder("\"HP:0008\"").build(); assertThat(vocabulary.getConceptFromId(query).get(), is(hippocampus)); }
@Test public void testGetByCurie() { Query query = new Vocabulary.Query.Builder("HP:0008").build(); assertThat(vocabulary.getConceptFromId(query).get(), is(hippocampus)); }
@Test public void testIdWithSpacesNoException() { Query query = new Vocabulary.Query.Builder("with space").build(); assertThat(vocabulary.getConceptFromId(query).isPresent(), is(false)); }