driver-core/src/main/com/mongodb/connection/ServerDescription.java
public boolean hasTags(final TagSet desiredTags) {
        if (!ok) {
            return false;
        }

        if (type == STANDALONE || type == SHARD_ROUTER) {
            return true;
        }

        return tagSet.containsAll(desiredTags);
    }
public boolean hasTags(final TagSet desiredTags) {
        if (!ok) {
            return false;
        }

        if (type == STANDALONE || type == SHARD_ROUTER) {
            return true;
        }

        return tagSet.containsAll(desiredTags);
    }
Returns true if the server has the given tags.  A server of either type {@code ServerType.STANDALONE} or {@code
ServerType.SHARD_ROUTER} is considered to have all tags, so this method will always return true for instances of either of those
types.

@param desiredTags the tags
@return true if this server has the given tags