### Question:
MetadataDrivers { public static void registerClientDriver(String metadataBackendScheme, Class<? extends MetadataClientDriver> driver) { registerClientDriver(metadataBackendScheme, driver, false); }  static void registerClientDriver(String metadataBackendScheme,
                                            Class<? extends MetadataClientDriver> driver); @VisibleForTesting static void registerClientDriver(String metadataBackendScheme,
                                            Class<? extends MetadataClientDriver> driver,
                                            boolean allowOverride); static void registerBookieDriver(String metadataBackendScheme,
                                            Class<? extends MetadataBookieDriver> driver); @VisibleForTesting static void registerBookieDriver(String metadataBackendScheme,
                                            Class<? extends MetadataBookieDriver> driver,
                                            boolean allowOverride); static MetadataClientDriver getClientDriver(String scheme); static MetadataClientDriver getClientDriver(URI uri); static MetadataBookieDriver getBookieDriver(String scheme); static MetadataBookieDriver getBookieDriver(URI uri); static T runFunctionWithMetadataClientDriver(ClientConfiguration conf,
                                                            Function<MetadataClientDriver, T> function,
                                                            ScheduledExecutorService executorService); static T runFunctionWithMetadataBookieDriver(ServerConfiguration conf,
                                                            Function<MetadataBookieDriver, T> function); static T runFunctionWithRegistrationManager(ServerConfiguration conf,
                                                           Function<RegistrationManager, T> function); static T runFunctionWithLedgerManagerFactory(ServerConfiguration conf,
                                                            Function<LedgerManagerFactory, T> function);  }### Answer:
@Test public void testRegisterClientDriver() throws Exception { MetadataClientDriver clientDriver = mock(MetadataClientDriver.class); when(clientDriver.getScheme()).thenReturn("testdriver"); try { MetadataDrivers.getClientDriver(clientDriver.getScheme()); fail("Should fail to get client driver if it is not registered"); } catch (IllegalArgumentException iae) { } MetadataDrivers.registerClientDriver(clientDriver.getScheme(), clientDriver.getClass()); MetadataClientDriver driver = MetadataDrivers.getClientDriver(clientDriver.getScheme()); assertEquals(clientDriver.getClass(), driver.getClass()); }