### Question:
MetadataDrivers { public static void registerBookieDriver(String metadataBackendScheme, Class<? extends MetadataBookieDriver> driver) { registerBookieDriver(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 testRegisterBookieDriver() throws Exception { MetadataBookieDriver bookieDriver = mock(MetadataBookieDriver.class); when(bookieDriver.getScheme()).thenReturn("testdriver"); try { MetadataDrivers.getBookieDriver(bookieDriver.getScheme()); fail("Should fail to get bookie driver if it is not registered"); } catch (IllegalArgumentException iae) { } MetadataDrivers.registerBookieDriver(bookieDriver.getScheme(), bookieDriver.getClass()); MetadataBookieDriver driver = MetadataDrivers.getBookieDriver(bookieDriver.getScheme()); assertEquals(bookieDriver.getClass(), driver.getClass()); }