FingerprintDecryptionResult extends FingerprintAuthenticationResult { public char[] getDecryptedChars() { if (!isSuccess()) { throw new IllegalAccessError("Fingerprint authentication was not successful, cannot access decryption result"); } return decrypted; } FingerprintDecryptionResult(FingerprintResult result, String message, char[] decrypted); String getDecrypted(); char[] getDecryptedChars();  }
@Test public void getResultSuccess() throws Exception { char[] decrypted = "decrypted".toCharArray(); FingerprintDecryptionResult result = new FingerprintDecryptionResult(FingerprintResult.AUTHENTICATED, null, decrypted); assertNull(result.getMessage()); assertEquals(decrypted, result.getDecryptedChars()); }