Here you can find the source of checkSum(List
private static long checkSum(List<String> stringList)
//package com.java2s; //License from project: Apache License import java.util.List; import java.util.Map; import java.util.Map.Entry; public class Main { private static final long PRIME = 31; private static long checkSum(List<String> stringList) { long result = 1; for (String string : stringList) { result = (result * PRIME) + checkSum(string); }/*from w w w . ja va 2 s . c o m*/ return result; } public static long checkSum(Map<String, List<String>> stringMap) { long result = 1; for (Entry<String, List<String>> entry : stringMap.entrySet()) { result = (result * PRIME) + checkSum(entry.getKey()); result = (result * PRIME) + checkSum(entry.getValue()); } return result; } public static long checkSum(String[] stringArray) { long result = 1; for (String string : stringArray) { result = (result * PRIME) + checkSum(string); } return result; } public static long checkSum(String string) { return (long) string.hashCode(); } }