private static int getMatches(String originalString, String anotherString) {
        //Calculates the number of matching characters betweent the two strings
        int matches = 0;
        if (originalString.length() > anotherString.length()) {
            for (int counter = 0; counter < anotherString.length(); counter++) {
                if (originalString.indexOf(anotherString.charAt(counter)) >= 0) {
                    matches++;
                }
            }
        } else if (originalString.length() < anotherString.length()) {
            for (int counter = 0; counter < originalString.length(); counter++) {
                if (anotherString.indexOf(originalString.charAt(counter)) >= 0) {
                    matches++;
                }
            }
        } else if (originalString.length() == anotherString.length()) {
            char[] originalArray = originalString.toCharArray();
            char[] anotherArray = anotherString.toCharArray();

            Arrays.sort(originalArray);
            Arrays.sort(anotherArray);

            for (int counter = 0; counter < originalArray.length; counter++) {
                if (originalArray[counter] == anotherArray[counter]) {
                    matches++;
                }
            }
        }
        return matches;
    }