public PeerId selectLeader(final String groupId) {
        Requires.requireTrue(!StringUtils.isBlank(groupId), "Blank group id");

        final GroupConf gc = this.groupConfTable.get(groupId);
        if (gc == null) {
            return null;
        }
        final StampedLock stampedLock = gc.stampedLock;
        long stamp = stampedLock.tryOptimisticRead();
        PeerId leader = gc.leader;
        if (!stampedLock.validate(stamp)) {
            stamp = stampedLock.readLock();
            try {
                leader = gc.leader;
            } finally {
                stampedLock.unlockRead(stamp);
            }
        }
        return leader;
    }
Get the cached leader of the group, return it when found, null otherwise.
Make sure calls {@link #refreshLeader(CliClientService, String, int)} already
before invoke this method.

@param groupId raft group id
@return peer of leader
jraft-core/src/main/java/com/alipay/sofa/jraft/RouteTable.java