### Question:
ZKMetadataDriverBase implements AutoCloseable { @SneakyThrows public synchronized LedgerManagerFactory getLedgerManagerFactory() throws MetadataException { if (null == lmFactory) { try { lmFactory = AbstractZkLedgerManagerFactory.newLedgerManagerFactory( conf, layoutManager); } catch (IOException e) { throw new MetadataException( Code.METADATA_SERVICE_ERROR, "Failed to initialized ledger manager factory", e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw e; } } return lmFactory; }  static String getZKServersFromServiceUri(URI uri); @SuppressWarnings("deprecation") static String resolveZkServers(AbstractConfiguration<?> conf); @SuppressWarnings("deprecation") static String resolveZkLedgersRootPath(AbstractConfiguration<?> conf); @SuppressWarnings("deprecation") static Class<? extends LedgerManagerFactory> resolveLedgerManagerFactory(URI metadataServiceUri); String getScheme(); LayoutManager getLayoutManager(); @SneakyThrows synchronized LedgerManagerFactory getLedgerManagerFactory(); @Override void close();  }### Answer:
@Test public void testGetLedgerManagerFactory() throws Exception { driver.initialize( conf, NullStatsLogger.INSTANCE, retryPolicy, Optional.empty()); mockStatic(AbstractZkLedgerManagerFactory.class); LedgerManagerFactory factory = mock(LedgerManagerFactory.class); PowerMockito.when( AbstractZkLedgerManagerFactory.class, "newLedgerManagerFactory", same(conf), same(driver.layoutManager)) .thenReturn(factory); assertSame(factory, driver.getLedgerManagerFactory()); assertSame(factory, driver.lmFactory); verifyStatic(AbstractZkLedgerManagerFactory.class, times(1)); AbstractZkLedgerManagerFactory.newLedgerManagerFactory( same(conf), same(driver.layoutManager)); driver.close(); verify(factory, times(1)).close(); assertNull(driver.lmFactory); }