@Test
public void isMatchingCanary_whenDecryptThrowsExceptionWithCauseIndicatingTheKeyIsIncorrect_returnsFalse() throws Exception {

  subject = new LunaKeyProxy(encryptionKey,
    new PasswordEncryptionService(new TestPasswordKeyProxyFactory()) {
      @Override
      public String decrypt(final Key key, final byte[] encryptedValue, final byte[] nonce) {
        throw new RuntimeException(new RuntimeException("returns 0x40 (CKR_ENCRYPTED_DATA_INVALID)"));
      }
    });
  assertThat(subject.matchesCanary(mock(EncryptionKeyCanary.class)), equalTo(false));
}