private MappingInfrastructure createInfrastructure(Neo4jMappingContext mappingContext)
     throws Exception {
   MappingInfrastructure infrastructure = new MappingInfrastructure();
   final GraphDatabaseService gdb = new ImpermanentGraphDatabase();
   infrastructure.setGraphDatabaseService(gdb);
   final DelegatingGraphDatabase graphDatabase = new DelegatingGraphDatabase(gdb);
   infrastructure.setGraphDatabase(graphDatabase);
   infrastructure.setMappingContext(mappingContext);
   final EntityStateHandler entityStateHandler =
       new EntityStateHandler(mappingContext, graphDatabase);
   infrastructure.setNodeTypeRepresentationStrategy(new NoopNodeTypeRepresentationStrategy());
   infrastructure.setRelationshipTypeRepresentationStrategy(
       new NoopRelationshipTypeRepresentationStrategy());
   infrastructure.setConversionService(new Neo4jConversionServiceFactoryBean().getObject());
   infrastructure.setEntityStateHandler(entityStateHandler);
   return infrastructure;
 }