class NotificationUtils implements Serializable {

    public boolean isHashValid(Map<String, String> parameterMap, String secret) {
        Map<String, String> map = new HashMap<String, String>(parameterMap);
        map.put("notification_secret", secret);

        checkAllParametersNotNull(map);

        String realHash = calculateHash(map);
        String sha1HashParam = map.get("sha1_hash");

        boolean equals = realHash.equalsIgnoreCase(sha1HashParam);
        if (!equals) {
            LOG.debug("the hashes are not equals. expected: " + realHash + ", but received: " + sha1HashParam);
        }
        return equals;
    }

}

class NotificationUtilsTest {

    public static final NotificationUtils NOTIFICATION_UTILS;
    public static final String SECRET;
     String string;

    @Test
    public void testCheckHash() throws Exception {

        assertTrue(NOTIFICATION_UTILS.isHashValid(createParamsMap(), SECRET));
    }

}