### Question:
DataLayerConnectionFactoryCache implements Provider<ConnectionFactory>, ShutdownListener { public synchronized ConnectionFactory get() throws InvalidConfigurationException { if (shutdown) { throw new IllegalStateException("Shutdown requested"); } debug("Requesting ConnectionFactory for type {0}", connectionType.name()); if (factory == null) { factory = connectionFactoryProvider.createFactory(); } return factory; } @Inject  DataLayerConnectionFactoryCache(ConnectionType connectionType,
            ShutdownManager shutdownManager,
            ConnectionFactoryProvider connectionFactoryProvider,
            @Named(DataLayerConstants.DATA_LAYER_DEBUG) Debug debug); synchronized ConnectionFactory get(); @Override synchronized void shutdown();  }### Answer:
@Test public void shouldOnlyCallCreateFactoryOncePerType() throws InvalidConfigurationException { provider.get(); provider.get(); verify(mockFactoryProvider, times(1)).createFactory(); }