public List<String> complete(final String prefix, final int count) {
        // 1. Find the position of the prefix in the sorted set in Redis
        if (null == prefix) {
            return Collections.emptyList();
        }
        int prefixLength = prefix.length();
        Long start = redis.zrank(redisKey, prefix);
        if (start < 0 || prefixLength == 0) {
            return Collections.emptyList();
        }
        List<String> results = new ArrayList<String>();
        int found = 0, rangeLength = 50, maxNeeded = count;
        while (found < maxNeeded) {
            Set<String> rangeResults = redis.zrange(redisKey, start, start + rangeLength - 1);
            start += rangeLength;
            if (rangeResults.isEmpty()) {
                break;
            }
            for (final String entry : rangeResults) {
                int minLength = Math.min(entry.length(), prefixLength);
                if (!entry.substring(0, minLength).equalsIgnoreCase(prefix.substring(0, minLength))) {
                    maxNeeded = results.size();
                    break;
                }
                if (entry.endsWith("*") && results.size() < maxNeeded) {
                    results.add(entry.substring(0, entry.length() - 2));
                }
            }
        }
        return results;
    }