driver-legacy/src/main/com/mongodb/ReplicaSetStatus.java
@SuppressWarnings("deprecation")
    @Nullable
    public ServerAddress getMaster() {
        List<ServerDescription> primaries = getClusterDescription().getPrimaries();
        return primaries.isEmpty() ? null : primaries.get(0).getAddress();
    }
@SuppressWarnings("deprecation")
    @Nullable
    public ServerAddress getMaster() {
        List<ServerDescription> primaries = getClusterDescription().getPrimaries();
        return primaries.isEmpty() ? null : primaries.get(0).getAddress();
    }
Gets the ServerAddress of the master server in this replica set.

@return master or null if don't have one
@throws MongoException if there's a failure