### Question:
LanguageDriverRegistry { public void register(Class<? extends LanguageDriver> cls) { if (cls == null) { throw new IllegalArgumentException("null is not a valid Language Driver"); } LANGUAGE_DRIVER_MAP.computeIfAbsent(cls, k -> { try { return k.getDeclaredConstructor().newInstance(); } catch (Exception ex) { throw new ScriptingException("Failed to load language driver for " + cls.getName(), ex); } }); }  void register(Class<? extends LanguageDriver> cls); void register(LanguageDriver instance); LanguageDriver getDriver(Class<? extends LanguageDriver> cls); LanguageDriver getDefaultDriver(); Class<? extends LanguageDriver> getDefaultDriverClass(); void setDefaultDriverClass(Class<? extends LanguageDriver> defaultDriverClass);  }### Answer:
@Test void registerByTypeNull() { when(() -> registry.register((Class<? extends LanguageDriver>) null)); then(caughtException()).isInstanceOf(IllegalArgumentException.class) .hasMessage("null is not a valid Language Driver"); }
@Test void registerByTypeDoesNotCreateNewInstance() { when(() -> registry.register(PrivateLanguageDriver.class)); then(caughtException()).isInstanceOf(ScriptingException.class) .hasMessage("Failed to load language driver for org.apache.ibatis.scripting.LanguageDriverRegistryTest$PrivateLanguageDriver"); }
@Test void registerByInstanceNull() { when(() -> registry.register((LanguageDriver) null)); then(caughtException()).isInstanceOf(IllegalArgumentException.class) .hasMessage("null is not a valid Language Driver"); }