VersionTable { public static int getVersion(SQLiteDatabase database, @Feature int feature, String instanceUid) throws DatabaseIOException { try { if (!tableExists(database, TABLE_NAME)) { return VERSION_UNSET; } try (Cursor cursor = database.query( TABLE_NAME, new String[] {COLUMN_VERSION}, WHERE_FEATURE_AND_INSTANCE_UID_EQUALS, featureAndInstanceUidArguments(feature, instanceUid), null, null, null)) { if (cursor.getCount() == 0) { return VERSION_UNSET; } cursor.moveToNext(); return cursor.getInt( 0); } } catch (SQLException e) { throw new DatabaseIOException(e); } } private  VersionTable(); static void setVersion(
      SQLiteDatabase writableDatabase, @Feature int feature, String instanceUid, int version); static void removeVersion(
      SQLiteDatabase writableDatabase, @Feature int feature, String instanceUid); static int getVersion(SQLiteDatabase database, @Feature int feature, String instanceUid); static final int VERSION_UNSET; static final int FEATURE_OFFLINE; static final int FEATURE_CACHE_CONTENT_METADATA; static final int FEATURE_CACHE_FILE_METADATA; }
@Test public void getVersion_unsetFeature_returnsVersionUnset() throws DatabaseIOException { int version = VersionTable.getVersion(database, FEATURE_1, INSTANCE_1); assertThat(version).isEqualTo(VersionTable.VERSION_UNSET); }