### Question:
EncryptionKey { public SecretKey loadKey() { byte[] encoded; try { encoded = decodeHex(encryptionKey.toCharArray()); } catch (DecoderException e) { return null; } return new SecretKeySpec(encoded, "AES"); } EncryptionKey();  EncryptionKey(final String encryptionKey); SecretKey loadKey(); String getEncryptionKey(); void setEncryptionKey(final String encryptionKey);  }### Answer:
@Test public void testLoadKey() throws IOException { String jsonString = "{\"encryptionKey\": \"e5419ab619863c4cb44425ce892fea8e\"}"; EncryptionKey key = stringToEncryptionKey(jsonString); assertNotNull(key.loadKey()); jsonString = "{\"encryptionKey\": \"wrong key\"}"; key = stringToEncryptionKey(jsonString); assertNull(key.loadKey()); assertEquals(key.getEncryptionKey(), "wrong key"); }