BrokerInterceptor implements Interceptor { @Override public void notifyTopicUnsubscribed(final String topic, final String clientID, final String username) { for (final InterceptHandler handler : this.handlers.get(InterceptUnsubscribeMessage.class)) { LOG.debug("Notifying MQTT UNSUBSCRIBE message to interceptor. CId={}, topic={}, interceptorId={}", clientID, topic, handler.getID()); executor.execute(() -> handler.onUnsubscribe(new InterceptUnsubscribeMessage(topic, clientID, username))); } } private  BrokerInterceptor(int poolSize, List<InterceptHandler> handlers);   BrokerInterceptor(List<InterceptHandler> handlers);   BrokerInterceptor(IConfig props, List<InterceptHandler> handlers); @Override void notifyClientConnected(final MqttConnectMessage msg); @Override void notifyClientDisconnected(final String clientID, final String username); @Override void notifyClientConnectionLost(final String clientID, final String username); @Override void notifyTopicPublished(final MqttPublishMessage msg, final String clientID, final String username); @Override void notifyTopicSubscribed(final Subscription sub, final String username); @Override void notifyTopicUnsubscribed(final String topic, final String clientID, final String username); @Override void notifyMessageAcknowledged(final InterceptAcknowledgedMessage msg); @Override void addInterceptHandler(InterceptHandler interceptHandler); @Override void removeInterceptHandler(InterceptHandler interceptHandler);  }
@Test public void testNotifyTopicUnsubscribed() throws Exception { interceptor.notifyTopicUnsubscribed("o2", "cli1234", "cli1234"); interval(); assertEquals(80, n.get()); }