### Question:
Algorithm { public static Algorithm RSA512(RSAKeyProvider keyProvider) throws IllegalArgumentException { return new RSAAlgorithm("RS512", "SHA512withRSA", keyProvider); } protected  Algorithm(String name, String description); static Algorithm RSA256(RSAKeyProvider keyProvider); static Algorithm RSA256(RSAPublicKey publicKey, RSAPrivateKey privateKey); @Deprecated static Algorithm RSA256(RSAKey key); static Algorithm RSA384(RSAKeyProvider keyProvider); static Algorithm RSA384(RSAPublicKey publicKey, RSAPrivateKey privateKey); @Deprecated static Algorithm RSA384(RSAKey key); static Algorithm RSA512(RSAKeyProvider keyProvider); static Algorithm RSA512(RSAPublicKey publicKey, RSAPrivateKey privateKey); @Deprecated static Algorithm RSA512(RSAKey key); static Algorithm HMAC256(String secret); static Algorithm HMAC384(String secret); static Algorithm HMAC512(String secret); static Algorithm HMAC256(byte[] secret); static Algorithm ECDSA256K(ECDSAKeyProvider keyProvider); static Algorithm ECDSA256K(ECPublicKey publicKey, ECPrivateKey privateKey); static Algorithm HMAC384(byte[] secret); static Algorithm HMAC512(byte[] secret); static Algorithm ECDSA256(ECDSAKeyProvider keyProvider); static Algorithm ECDSA256(ECPublicKey publicKey, ECPrivateKey privateKey); @Deprecated static Algorithm ECDSA256(ECKey key); static Algorithm ECDSA384(ECDSAKeyProvider keyProvider); static Algorithm ECDSA384(ECPublicKey publicKey, ECPrivateKey privateKey); @Deprecated static Algorithm ECDSA384(ECKey key); static Algorithm ECDSA512(ECDSAKeyProvider keyProvider); static Algorithm ECDSA512(ECPublicKey publicKey, ECPrivateKey privateKey); @Deprecated static Algorithm ECDSA512(ECKey key); static Algorithm none(); String getSigningKeyId(); String getName(); @Override String toString(); abstract void verify(DecodedJWT jwt); byte[] sign(byte[] headerBytes, byte[] payloadBytes); @Deprecated abstract byte[] sign(byte[] contentBytes);  }### Answer:
@Test public void shouldThrowRSA512InstanceWithNullKey() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Both provided Keys cannot be null."); RSAKey key = null; Algorithm.RSA512(key); }
@Test public void shouldThrowRSA512InstanceWithNullKeys() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("Both provided Keys cannot be null."); Algorithm.RSA512(null, null); }
@Test public void shouldThrowRSA512InstanceWithNullKeyProvider() throws Exception { exception.expect(IllegalArgumentException.class); exception.expectMessage("The Key Provider cannot be null."); RSAKeyProvider provider = null; Algorithm.RSA512(provider); }