NotificationUtils implements Serializable { String createStringForHash(Map<String, String> parameterMap) { List<String> strings = new ArrayList<String>(); for (String paramName : EXPECTED_PARAMS_ARRAY) { strings.add(parameterMap.get(paramName)); } StringBuilder stringForHash = new StringBuilder(strings.get(0)); for (String param : strings.subList(1, strings.size())) { stringForHash.append(DELIMITER).append(param); } return stringForHash.toString(); }  boolean isHashValid(Map<String, String> parameterMap, String secret); String calculateHash(Map<String, String> parameterMap, String secret); static final String[] EXPECTED_PARAMS_ARRAY; }
@Test public void testString() { Map<String, String> paramsMap = createParamsMap(); paramsMap.put("notification_secret", SECRET); assertEquals(string, NOTIFICATION_UTILS.createStringForHash(paramsMap)); }