### Question:
ReflectiveEntityDriverFactory { public DriverInferenceRule addClassFullNameMapping(String expectedClassFullName, String newClassFullName) { DriverInferenceByRenamingClassFullName rule = new DriverInferenceByRenamingClassFullName(expectedClassFullName, newClassFullName); return addRule(rule.getIdentifier(), rule); } ReflectiveEntityDriverFactory(); DriverInferenceRule addRule(String identifier, DriverInferenceRule rule); DriverInferenceRule addClassFullNameMapping(String expectedClassFullName, String newClassFullName); DriverInferenceRule addClassSimpleNameMapping(String expectedClassSimpleName, String newClassSimpleName); D build(DriverDependentEntity<D> entity, Location location);  }### Answer:
@Test public void testFullNameMapping() throws Exception { factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName()); assertDriverIs(MyCustomDriver.class, sshLocation); }
@Test public void testFullNameMappingMulti() throws Exception { factory.addClassFullNameMapping(MyDriver.class.getName(), "X"); factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName()); assertDriverIs(MyCustomDriver.class, sshLocation); }
@Test public void testFullNameMappingFailure1() throws Exception { factory.addClassFullNameMapping(MyDriver.class.getName()+"X", MyCustomDriver.class.getName()); assertDriverIs(MySshDriver.class, sshLocation); }
@Test public void testFullNameMappingFailure2() throws Exception { factory.addClassFullNameMapping(MyDriver.class.getName(), MyCustomDriver.class.getName()); factory.addClassFullNameMapping(MyDriver.class.getName(), "X"); assertDriverIs(MySshDriver.class, sshLocation); }