    @Test
    public void testInvalidValid () throws AssertionError, NoSuchAlgorithmException, InvalidKeyException {

        try {
            byte[] payLoad =  UUID.randomUUID().toString().getBytes();
            KeyGenerator gen = KeyGenerator.getInstance("HmacSHA256");
            SecretKey badSecretKey = gen.generateKey();

            APIAuthentication.validate(
              APICredential.builder()
                .version(APIAuthentication.VERSION)
                .timestamp(System.currentTimeMillis())
                .nonce(UUID.randomUUID().toString())
                .hash("invalidHash".getBytes()).build(),
              badSecretKey, payLoad
            );
        } catch (IllegalArgumentException e) {
            assertTrue ("invalid.hash".equals(e.getMessage()), "Returned " + e.getMessage() + " instead of 'invalid.hash'");
            return;
        }
        fail ("Validation failed to catch invalid.hash");
    }