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;
    }

}