public Match findMatch(char[] buffer) {
        Match bestMatch = new Match();
        for (int i = 0; i < buffer.length; i++) {
            char c = buffer[i];
            for (int j = i + 1; j < buffer.length; j++) {
                if (buffer[j] == c) {
                    String current = "" + c;
                    String other = ""+ buffer[j];
                    int l = findMatchLength(current, other, buffer, i, j);
                    if (l > 2 && l > bestMatch.getLength()) {
                        bestMatch = setBestMatch(l, j, i);
                    }
                    
                }
            }
        }
        return bestMatch;
    }