### Question:
DaoManager { public static synchronized void registerDao(ConnectionSource connectionSource, Dao<?, ?> dao) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } addDaoToClassMap(new ClassConnectionSource(connectionSource, dao.getDataClass()), dao); }  synchronized static D createDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D lookupDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D createDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); synchronized static D lookupDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); static synchronized void registerDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void registerDaoWithTableConfig(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void clearCache(); static synchronized void clearDaoCache(); static synchronized void addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs);  }### Answer:
@Test public void testRegisterDao() throws Exception { Dao<RegisterClass, Void> dao = DaoManager.lookupDao(connectionSource, RegisterClass.class); assertNull(dao); Dao<? extends RegisterClass, Object> daoImpl = BaseDaoImpl.createDao(connectionSource, RegisterClass.class); DaoManager.registerDao(connectionSource, daoImpl); dao = DaoManager.lookupDao(connectionSource, RegisterClass.class); assertSame(daoImpl, dao); }
@Test(expected = IllegalArgumentException.class) public void testRegisterNull() { DaoManager.registerDao(null, null); }