### Question:
RecoverableKeyStoreSecondaryKeyManager { public RecoverableKeyStoreSecondaryKey generate() throws InternalRecoveryServiceException, LockScreenRequiredException, UnrecoverableKeyException { String alias = generateId(); mRecoveryController.generateKey(alias); SecretKey key = (SecretKey) mRecoveryController.getKey(alias); if (key == null) { throw new InternalRecoveryServiceException( String.format( "Generated key %s but could not get it back immediately afterwards.", alias)); } return new RecoverableKeyStoreSecondaryKey(alias, key); } @VisibleForTesting  RecoverableKeyStoreSecondaryKeyManager(
            RecoveryController recoveryController, SecureRandom secureRandom); static RecoverableKeyStoreSecondaryKeyManager getInstance(Context context); RecoverableKeyStoreSecondaryKey generate(); void remove(String alias); Optional<RecoverableKeyStoreSecondaryKey> get(String alias);  }### Answer:
@Test public void generate_generatesKeyWithExpectedPrefix() throws Exception { RecoverableKeyStoreSecondaryKey key = mRecoverableKeyStoreSecondaryKeyManager.generate(); assertThat(key.getAlias()).startsWith(BACKUP_KEY_ALIAS_PREFIX); }
@Test public void generate_generatesKeyWithExpectedLength() throws Exception { RecoverableKeyStoreSecondaryKey key = mRecoverableKeyStoreSecondaryKeyManager.generate(); assertThat(key.getAlias()).hasLength(BACKUP_KEY_ALIAS_LENGTH); }