### Question:
DefaultSubscriptionTreeMatcher implements SubscriptionMatcher { @Override public boolean subscribe(Subscription subscription) { try{ String topic = subscription.getTopic(); TreeNode currentNode = recursionGetTreeNode(topic,root); Set<Subscription> subscriptions = currentNode.getSubscribers(); if(subscriptions.contains(subscription)){ for(Subscription sub : subscriptions){ if(sub.equals(subscription)){ if(sub.getQos() == subscription.getQos()){ return false; }else{ sub.setQos(subscription.getQos()); return true; } } } } currentNode.addSubscriber(subscription); }catch(Exception ex){ log.warn("[Subscription] -> Subscribe failed,clientId={},topic={},qos={}",subscription.getClientId(),subscription.getTopic(),subscription.getQos()); return true; } return true; } DefaultSubscriptionTreeMatcher(); @Override boolean subscribe(Subscription subscription); @Override boolean unSubscribe(String topic, String clientId); @Override Set<Subscription> match(String topic); @Override boolean isMatch(String pubTopic, String subTopic);  }### Answer:
@Test public void subscribe() { String topic = "MQTT_TEST/2/+/E/#"; String clientId = "clientid_test"; Subscription subscription = new Subscription(clientId,topic,1); Assert.assertTrue(this.subscriptionMatcher.subscribe(subscription)); }