code: public boolean isMaster(final ServerAddress serverAddress) {
          ServerAddress masterServerAddress = getMaster();
          return masterServerAddress != null && masterServerAddress.equals(serverAddress);
      }
docs: Checks to see if a given server is the primary server in this replica set.
  
  @param serverAddress the server to compare
  @return true if the given ServerAddress is the current Master/Primary