public int compare(Object a, Object b) {
            String sa = (String)a;
            String sb = (String)b;
            
            int alen = sa.length();
            int blen = sb.length();
            int mlen = Math.min(alen, blen);
            
            for (int i=0; i<mlen; i++) {
                char ca = sa.charAt(i);
                char cb = sb.charAt(i);
                if (ca == '*') {
                    if (cb != '*') {
                        // Wildcard sorted high.
                        return 1;
                    }
                } else if (cb == '*') {
                    // Wildcard sorted high.
                    return -1;
                } else if (ca < cb) {
                    return -1;
                } else if (ca > cb) {
                    return 1;
                }
            }
            
            // The shorter string is sorted high.
            if (alen < blen) {
                return 1;
            } else if (alen > blen) {
                return -1;
            }
            
            return 0;
        }