### Question:
Neo4jMappingContext extends AbstractMappingContext<Neo4jPersistentEntity<?>, Neo4jPersistentProperty> implements Schema { @Override public <T extends IdGenerator<?>> T getOrCreateIdGeneratorOfType(Class<T> idGeneratorType) { if (this.idGenerators.containsKey(idGeneratorType)) { return (T) this.idGenerators.get(idGeneratorType); } else { T idGenerator; if (this.beanFactory == null) { idGenerator = BeanUtils.instantiateClass(idGeneratorType); } else { idGenerator = this.beanFactory.getBeanProvider(idGeneratorType) .getIfUnique(() -> this.beanFactory.createBean(idGeneratorType)); } this.idGenerators.put(idGeneratorType, idGenerator); return idGenerator; } } Neo4jMappingContext();  Neo4jMappingContext(Neo4jConversions neo4jConversions); Neo4jConverter getConverter(); @Override @Nullable NodeDescription<?> getNodeDescription(String primaryLabel); @Override NodeDescription<?> getNodeDescription(Class<?> underlyingClass); @Override Optional<Neo4jPersistentEntity<?>> addPersistentEntity(Class<?> type); @Override T getOrCreateIdGeneratorOfType(Class<T> idGeneratorType); @Override Optional<T> getIdGenerator(String reference); @Override void setApplicationContext(ApplicationContext applicationContext);  }### Answer:
@Test void shouldCacheIdGenerators() { Neo4jMappingContext schema = new Neo4jMappingContext(); IdGenerator<?> dummyIdGenerator1 = schema.getOrCreateIdGeneratorOfType(DummyIdGenerator.class); IdGenerator<?> dummyIdGenerator2 = schema.getOrCreateIdGeneratorOfType(DummyIdGenerator.class); assertThat(dummyIdGenerator1).isSameAs(dummyIdGenerator2); }