### Question:
TertiaryKeysTable { public Map<String, TertiaryKey> getAllKeys(String secondaryKeyAlias) throws EncryptionDbException { SQLiteDatabase db = mHelper.getReadableDatabaseSafe(); String[] projection = { TertiaryKeysEntry._ID, TertiaryKeysEntry.COLUMN_NAME_SECONDARY_KEY_ALIAS, TertiaryKeysEntry.COLUMN_NAME_PACKAGE_NAME, TertiaryKeysEntry.COLUMN_NAME_WRAPPED_KEY_BYTES }; String selection = TertiaryKeysEntry.COLUMN_NAME_SECONDARY_KEY_ALIAS + " = ?"; String[] selectionArguments = {secondaryKeyAlias}; Map<String, TertiaryKey> keysByPackageName = new ArrayMap<>(); try (Cursor cursor = db.query( TertiaryKeysEntry.TABLE_NAME, projection, selection, selectionArguments, null, null, null)) { while (cursor.moveToNext()) { String packageName = cursor.getString( cursor.getColumnIndexOrThrow( TertiaryKeysEntry.COLUMN_NAME_PACKAGE_NAME)); byte[] wrappedKeyBytes = cursor.getBlob( cursor.getColumnIndexOrThrow( TertiaryKeysEntry.COLUMN_NAME_WRAPPED_KEY_BYTES)); keysByPackageName.put( packageName, new TertiaryKey(secondaryKeyAlias, packageName, wrappedKeyBytes)); } } return Collections.unmodifiableMap(keysByPackageName); } TertiaryKeysTable(BackupEncryptionDbHelper helper); long addKey(TertiaryKey tertiaryKey); Optional<TertiaryKey> getKey(String secondaryKeyAlias, String packageName); Map<String, TertiaryKey> getAllKeys(String secondaryKeyAlias);  }### Answer:
@Test public void getAllKeys_withNoKeysForAlias_returnsEmptyMap() throws Exception { assertThat(mTertiaryKeysTable.getAllKeys(SECONDARY_ALIAS)).isEmpty(); }