public static String sign(final String algorithmName, final String key, final String data) {
        if (Objects.isNull(key) || Objects.isNull(data)) {
            throw new NullPointerException("Key or data is null.");
        }

        return Optional.ofNullable(SIGN_FUNCTION_MAP.get(algorithmName))
                .orElseThrow(() -> new UnsupportedOperationException("unsupported sign algorithm:" + algorithmName))
                .sign(key, data);
    }
@Test
    public void testGenerateMd5Sign() {

        assertThat(SignUtils.sign(SignUtils.SIGN_MD5, "test", "a1b2"),
                is("7aa98f7d67f8e4730e2d1d3902295ce6"));
    }