### Question:
MetadataDrivers { public static MetadataClientDriver getClientDriver(String scheme) { checkNotNull(scheme, "Client Driver Scheme is null"); MetadataClientDriverInfo driverInfo = clientDrivers.get(scheme.toLowerCase()); if (null == driverInfo) { throw new IllegalArgumentException("Unknown backend " + scheme); } return ReflectionUtils.newInstance(driverInfo.driverClass); }  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(expected = NullPointerException.class) public void testClientDriverNullScheme() { MetadataDrivers.getClientDriver((String) null); }
@Test(expected = NullPointerException.class) public void testClientDriverNullURI() { MetadataDrivers.getClientDriver((URI) null); }
@Test(expected = IllegalArgumentException.class) public void testClientDriverUnknownScheme() { MetadataDrivers.getClientDriver("unknown"); }
@Test(expected = IllegalArgumentException.class) public void testClientDriverUnknownSchemeURI() { MetadataDrivers.getClientDriver(URI.create("unknown: }
@Test(expected = NullPointerException.class) public void testClientDriverNullSchemeURI() { MetadataDrivers.getClientDriver(URI.create(" }
@Test public void testClientDriverLowerUpperCasedSchemes() { String[] schemes = new String[] { "zk", "Zk", "zK", "ZK" }; for (String scheme : schemes) { MetadataClientDriver clientDriver = MetadataDrivers.getClientDriver(scheme); assertEquals( ZK_CLIENT_DRIVER_CLASS, clientDriver.getClass().getName()); } }