RegistryEntityDriverFactory implements EntityDriverManager { public boolean hasDriver(DriverDependentEntity<?> entity, Location location) { return lookupDriver(entity.getDriverInterface(), location) != null; }  @Override D build(DriverDependentEntity<D> entity, Location location); boolean hasDriver(DriverDependentEntity<?> entity, Location location); @Override void registerDriver(Class<D> driverInterface, Class<? extends Location> locationClazz, Class<? extends D> driverClazz);  }
@Test public void testHasDriver() throws Exception { factory.registerDriver(MyDriver.class, SshMachineLocation.class, MyOtherSshDriver.class); assertTrue(factory.hasDriver(entity, sshLocation)); assertFalse(factory.hasDriver(entity, simulatedLocation)); }