### Question:
TableUtils { public static <T> int createTableIfNotExists(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException { Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass); return doCreateTable(dao, true); } private  TableUtils(); static int createTable(ConnectionSource connectionSource, Class<T> dataClass); static int createTable(Dao<?, ?> dao); static int createTableIfNotExists(ConnectionSource connectionSource, Class<T> dataClass); static int createTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig); static int createTableIfNotExists(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig); static List<String> getCreateTableStatements(ConnectionSource connectionSource, Class<T> dataClass); static List<String> getCreateTableStatements(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); static int dropTable(ConnectionSource connectionSource, Class<T> dataClass, boolean ignoreErrors); static int dropTable(Dao<T, ID> dao, boolean ignoreErrors); static int dropTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig,
			boolean ignoreErrors); static int clearTable(ConnectionSource connectionSource, Class<T> dataClass); static int clearTable(ConnectionSource connectionSource, DatabaseTableConfig<T> tableConfig);  }### Answer:
@Test public void testCreateTableIfNotExists() throws Exception { dropTable(LocalFoo.class, true); Dao<LocalFoo, Integer> fooDao = createDao(LocalFoo.class, false); try { fooDao.countOf(); fail("Should have thrown an exception"); } catch (Exception e) { } TableUtils.createTableIfNotExists(connectionSource, LocalFoo.class); assertEquals(0, fooDao.countOf()); TableUtils.createTableIfNotExists(connectionSource, LocalFoo.class); assertEquals(0, fooDao.countOf()); }