RxFingerprint { public static boolean keyInvalidated(Throwable throwable) { return throwable instanceof KeyPermanentlyInvalidatedException; }  static Observable<FingerprintAuthenticationResult> authenticate(@NonNull Context context); static Observable<FingerprintEncryptionResult> encrypt(@NonNull Context context, @NonNull String toEncrypt); static Observable<FingerprintEncryptionResult> encrypt(@NonNull Context context, @NonNull String toEncrypt, boolean keyInvalidatedByBiometricEnrollment); static Observable<FingerprintEncryptionResult> encrypt(@NonNull Context context, @NonNull char[] toEncrypt, boolean keyInvalidatedByBiometricEnrollment); static Observable<FingerprintDecryptionResult> decrypt(@NonNull Context context, @NonNull String encrypted); static Observable<FingerprintEncryptionResult> encrypt(@NonNull Context context, @Nullable String keyName, @NonNull String toEncrypt); static Observable<FingerprintEncryptionResult> encrypt(@NonNull Context context, @Nullable String keyName, @NonNull char[] toEncrypt); static Observable<FingerprintDecryptionResult> decrypt(@NonNull Context context, @Nullable String keyName, @NonNull String encrypted); static Observable<FingerprintEncryptionResult> encrypt(@NonNull EncryptionMethod method,
																  @NonNull Context context,
																  @Nullable String keyName,
																  @NonNull String toEncrypt); static Observable<FingerprintEncryptionResult> encrypt(@NonNull EncryptionMethod method,
																																@NonNull Context context,
																																@Nullable String keyName,
																																@NonNull char[] toEncrypt); static Observable<FingerprintEncryptionResult> encrypt(@NonNull EncryptionMethod method,
																  @NonNull Context context,
																  @Nullable String keyName,
																  @NonNull String toEncrypt,
																  boolean keyInvalidatedByBiometricEnrollment); static Observable<FingerprintEncryptionResult> encrypt(@NonNull EncryptionMethod method,
																																@NonNull Context context,
																																@Nullable String keyName,
																																@NonNull char[] toEncrypt,
																																boolean keyInvalidatedByBiometricEnrollment); static Observable<FingerprintDecryptionResult> decrypt(@NonNull EncryptionMethod method,
																  @NonNull Context context,
																  @Nullable String keyName,
																  @NonNull String toDecrypt); static boolean isAvailable(@NonNull Context context); static boolean isUnavailable(@NonNull Context context); @SuppressWarnings("MissingPermission") static boolean isHardwareDetected(@NonNull Context context); @SuppressWarnings("MissingPermission") static boolean hasEnrolledFingerprints(@NonNull Context context); static void setLogger(@NonNull RxFingerprintLogger logger); static void disableLogging(); static boolean keyInvalidated(Throwable throwable);  }
@Test public void testKeyInvalidatedException() throws Exception { Throwable throwable = new KeyPermanentlyInvalidatedException(); assertTrue("Should result to true", RxFingerprint.keyInvalidated(throwable)); }