### Question:
SchemaGenerator { protected ArrayList<String> getColumnNames(SQLiteDatabase sqLiteDatabase, String tableName) { Cursor resultsQuery = sqLiteDatabase.query(tableName, null, null, null, null, null, null); ArrayList<String> columnNames = new ArrayList<>(); for (int i = 0; i < resultsQuery.getColumnCount(); i++) { String columnName = resultsQuery.getColumnName(i); columnNames.add(columnName); } resultsQuery.close(); return columnNames; } private  SchemaGenerator(); static SchemaGenerator getInstance(); void createDatabase(SQLiteDatabase sqLiteDatabase); void afterTableCreated(Class<?> table, SQLiteDatabase sqLiteDatabase); void doUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion); void deleteTables(SQLiteDatabase sqLiteDatabase); static final String NULL; static final String NOT_NULL; static final String UNIQUE; static final String SUGAR; }### Answer:
@Test public void testGetColumnNames() { SQLiteDatabase sqLiteDatabase = SugarContext.getSugarContext().getSugarDb().getDB(); SchemaGenerator schemaGenerator = SchemaGenerator.getInstance(); schemaGenerator.createTable(TestRecord.class, sqLiteDatabase); List<String> columnNames = schemaGenerator.getColumnNames(sqLiteDatabase, NamingHelper.toTableName(TestRecord.class)); Assert.assertEquals(2, columnNames.size()); }