private boolean changeSubscription(Set<String> topicsToSubscribe) {
        if (subscription.equals(topicsToSubscribe))
            return false;

        subscription = topicsToSubscribe;
        return true;
    }
This method sets the subscription type if it is not already set (i.e. when it is NONE),
or verifies that the subscription type is equal to the give type when it is set (i.e.
when it is not NONE)
@param type The given subscription type
clients/src/main/java/org/apache/kafka/clients/consumer/internals/SubscriptionState.java