SQLiteUtils { @NonNull static List<String> createUniqueDefinition(TableInfo tableInfo) { ArrayList<String> definitions = new ArrayList<>(); SparseArray<UniqueGroupInfo> uniqueGroups = tableInfo.getUniqueGroups(); for (int i = 0; i < uniqueGroups.size(); i++) { int key = uniqueGroups.keyAt(i); UniqueGroupInfo uniqueGroupInfo = uniqueGroups.get(key); if (uniqueGroupInfo.columns.size() > 0) { definitions.add(String.format("UNIQUE (%s) ON CONFLICT %s", join(uniqueGroupInfo.columns), uniqueGroupInfo.uniqueConflict.toString())); } } return definitions; }  @NonNull static String getIdentityHash(Collection<TableInfo> tableInfos); @NonNull static ArrayList<String> getAllTableNames(SQLiteDatabase database); @NonNull static String createTableDefinition(TableInfo tableInfo); @NonNull static List<String> createIndexDefinition(TableInfo tableInfo); static SQLiteType getFieldSQLiteType(Field field, Map<Class<?>, TypeSerializer> typeSerializers); static Object getColumnFieldValue(Class<?> modelClass,
                                             Class<?> fieldType,
                                             Cursor cursor,
                                             int columnIndex); static void fillContentValuesForUpdate(Object model,
                                                  ModelAdapter modelAdapter,
                                                  ContentValues contentValues); static void fillContentValuesForInsert(Object model,
                                                  ModelAdapter modelAdapter,
                                                  ContentValues contentValues);  }
@Test public void testCreateUniqueDefinition() throws NoSuchFieldException { String expectedSql = "UNIQUE (`dateField`, `doubleField`) ON CONFLICT FAIL, " + "UNIQUE (`booleanField`, `intField`) ON CONFLICT ROLLBACK"; TableInfo testModelTableInfo = ReActiveAndroid.getTableInfo(FullTestModel.class); List<String> createUniqueDefinitions = SQLiteUtils.createUniqueDefinition(testModelTableInfo); assertEquals(expectedSql, TextUtils.join(", ", createUniqueDefinitions)); }