code: public DefaultMetadata withNodes(
        Map<UUID, Node> newNodes,
        boolean tokenMapEnabled,
        boolean tokensChanged,
        TokenFactory tokenFactory,
        InternalDriverContext context) {
  
      // Force a rebuild if at least one node has different tokens, or there are new or removed nodes.
      boolean forceFullRebuild = tokensChanged || !newNodes.equals(nodes);
  
      return new DefaultMetadata(
          ImmutableMap.copyOf(newNodes),
          this.keyspaces,
          rebuildTokenMap(
              newNodes, keyspaces, tokenMapEnabled, forceFullRebuild, tokenFactory, context));
    }
docs: Refreshes the current metadata with the given list of nodes.
  
  @param tokenMapEnabled whether to rebuild the token map or not; if this is {@code false} the
  current token map will be copied into the new metadata without being recomputed.
  @param tokensChanged whether we observed a change of tokens for at least one node. This will
  require a full rebuild of the token map.
  @param tokenFactory only needed for the initial refresh, afterwards the existing one in the
  token map is used.
  @return the new metadata.