### Question:
EncrypterManager { public synchronized void loadPublicKey(byte[] publicKey) throws GeneralSecurityException { try { capillaryPublicKey = CapillaryPublicKey.parseFrom(publicKey); } catch (InvalidProtocolBufferException e) { throw new GeneralSecurityException("unable to parse public key", e); } encrypter = rawLoadPublicKey(capillaryPublicKey.getKeyBytes().toByteArray()); isLoaded = true; }  synchronized void loadPublicKey(byte[] publicKey); synchronized byte[] encrypt(byte[] data); synchronized void clearPublicKey();  }### Answer:
@Test public void testLoadValidPublicKey() throws GeneralSecurityException { encrypterManager.loadPublicKey(publicKey.toByteArray()); }
@Test public void testLoadMalformedPublicKey() { byte[] publicKey = "malformed public key".getBytes(); try { encrypterManager.loadPublicKey(publicKey); fail("Did not throw GeneralSecurityException"); } catch (GeneralSecurityException e) { } }