public static double HammingDistance(String a, String b) {
		if (a.isEmpty() || a == null || b.isEmpty() || b == null)
			return -1;
		char[] arr1 = a.toCharArray();
		char[] arr2 = b.toCharArray();
		int result = 0, low = Math.min(arr1.length, arr2.length), high = Math
				.max(arr1.length, arr2.length);
		for (int i = 0; i < low; i++)
			result += (arr1[i] != arr2[i] ? 1 : 0);
		return ((double) ((result + high - low) / Math.max(a.length(), b.length())));
	}