### Question:
RecoverableKeyStoreSecondaryKey { public @Status int getStatus(Context context) { try { return getStatusInternal(context); } catch (InternalRecoveryServiceException e) { Slog.wtf(TAG, "Internal error getting recovery status", e); return Status.NOT_SYNCED; } } RecoverableKeyStoreSecondaryKey(String alias, SecretKey secretKey); String getAlias(); SecretKey getSecretKey(); @Status int getStatus(Context context);  }### Answer:
@Test public void getStatus_whenSynced_returnsSynced() throws Exception { setStatus(RecoveryController.RECOVERY_STATUS_SYNCED); int status = mSecondaryKey.getStatus(mContext); assertThat(status).isEqualTo(Status.SYNCED); }
@Test public void getStatus_whenNotSynced_returnsNotSynced() throws Exception { setStatus(RecoveryController.RECOVERY_STATUS_SYNC_IN_PROGRESS); int status = mSecondaryKey.getStatus(mContext); assertThat(status).isEqualTo(Status.NOT_SYNCED); }
@Test public void getStatus_onPermanentFailure_returnsDestroyed() throws Exception { setStatus(RecoveryController.RECOVERY_STATUS_PERMANENT_FAILURE); int status = mSecondaryKey.getStatus(mContext); assertThat(status).isEqualTo(Status.DESTROYED); }
@Test public void getStatus_forUnknownStatusCode_returnsNotSynced() throws Exception { setStatus(NONEXISTENT_STATUS_CODE); int status = mSecondaryKey.getStatus(mContext); assertThat(status).isEqualTo(Status.NOT_SYNCED); }
@Test public void getStatus_onInternalError_returnsNotSynced() throws Exception { ShadowRecoveryController.setThrowsInternalError(true); int status = mSecondaryKey.getStatus(mContext); assertThat(status).isEqualTo(Status.NOT_SYNCED); }