public void setSimpleLoadBalancerState(SimpleLoadBalancerState state)
  {
    _watcherManager.updateWatcher(state, this::doRegisterLoadBalancerState);
    doRegisterLoadBalancerState(state, null);

    state.register(new SimpleLoadBalancerStateListener()
    {
      @Override
      public void onStrategyAdded(String serviceName, String scheme, LoadBalancerStrategy strategy)
      {
        _watcherManager.updateWatcher(serviceName, scheme, strategy,
            (item, mode) -> doRegisterLoadBalancerStrategy(serviceName, scheme, item, mode));
        doRegisterLoadBalancerStrategy(serviceName, scheme, strategy, null);
      }

      @Override
      public void onStrategyRemoved(String serviceName, String scheme, LoadBalancerStrategy strategy)
      {
        _watcherManager.removeWatcherForLoadBalancerStrategy(serviceName, scheme);
        _jmxManager.unregister(getLoadBalancerStrategyJmxName(serviceName, scheme, null));
      }

      @Override
      public void onClientAdded(String clusterName, TrackerClient client)
      {
        // We currently think we can make this no-op as the info provided is not helpful
        //  _jmxManager.checkReg(new DegraderControl((DegraderImpl) client.getDegrader(DefaultPartitionAccessor.DEFAULT_PARTITION_ID)),
        //                   _prefix + "-" + clusterName + "-" + client.getUri().toString().replace("://", "-") + "-TrackerClient-Degrader");
      }

      @Override
      public void onClientRemoved(String clusterName, TrackerClient client)
      {
        // We currently think we can make this no-op as the info provided is not helpful
        //  _jmxManager.unregister(_prefix + "-" + clusterName + "-" + client.getUri().toString().replace("://", "-") + "-TrackerClient-Degrader");
      }

      @Override
      public void onClusterInfoUpdate(ClusterInfoItem clusterInfoItem)
      {
        if (clusterInfoItem != null && clusterInfoItem.getClusterPropertiesItem() != null
            && clusterInfoItem.getClusterPropertiesItem().getProperty() != null)
        {
          String clusterName = clusterInfoItem.getClusterPropertiesItem().getProperty().getClusterName();
          _watcherManager.updateWatcher(clusterName, clusterInfoItem,
              (item, mode) -> doRegisterClusterInfo(clusterName, item, mode));
          doRegisterClusterInfo(clusterName, clusterInfoItem, null);
        }
      }

      @Override
      public void onClusterInfoRemoval(ClusterInfoItem clusterInfoItem)
      {
        if (clusterInfoItem != null && clusterInfoItem.getClusterPropertiesItem() != null
            && clusterInfoItem.getClusterPropertiesItem().getProperty() != null)
        {
          String clusterName = clusterInfoItem.getClusterPropertiesItem().getProperty().getClusterName();
          _watcherManager.removeWatcherForClusterInfoItem(clusterName);
          _jmxManager.unregister(getClusterInfoJmxName(clusterName, null));
        }
      }

      @Override
      public void onServicePropertiesUpdate(LoadBalancerStateItem<ServiceProperties> serviceProperties)
      {
        if (serviceProperties != null && serviceProperties.getProperty() != null)
        {
          String serviceName = serviceProperties.getProperty().getServiceName();
          _watcherManager.updateWatcher(serviceName, serviceProperties,
              (item, mode) -> doRegisterServiceProperties(serviceName, item, mode));
          doRegisterServiceProperties(serviceName, serviceProperties, null);
        }
      }

      @Override
      public void onServicePropertiesRemoval(LoadBalancerStateItem<ServiceProperties> serviceProperties)
      {
        if (serviceProperties != null && serviceProperties.getProperty() != null)
        {
          String serviceName = serviceProperties.getProperty().getServiceName();
          _watcherManager.removeWatcherForServiceProperties(serviceName);
          _jmxManager.unregister(getServicePropertiesJmxName(serviceName, null));
        }
      }

      private void doRegisterLoadBalancerStrategy(String serviceName, String scheme, LoadBalancerStrategy strategy,
          @Nullable DualReadModeProvider.DualReadMode mode)
      {
        String jmxName = getLoadBalancerStrategyJmxName(serviceName, scheme, mode);
        _jmxManager.registerLoadBalancerStrategy(jmxName, strategy);
      }

      private void doRegisterClusterInfo(String clusterName, ClusterInfoItem clusterInfoItem,
          @Nullable DualReadModeProvider.DualReadMode mode)
      {
        String jmxName = getClusterInfoJmxName(clusterName, mode);
        _jmxManager.registerClusterInfo(jmxName, clusterInfoItem);
      }

      private void doRegisterServiceProperties(String serviceName, LoadBalancerStateItem<ServiceProperties> serviceProperties,
          @Nullable DualReadModeProvider.DualReadMode mode)
      {
        _jmxManager.registerServiceProperties(getServicePropertiesJmxName(serviceName, mode), serviceProperties);
      }

      private String getClusterInfoJmxName(String clusterName, @Nullable DualReadModeProvider.DualReadMode mode)
      {
        return String.format("%s%s-ClusterInfo", getClusterPrefixForLBPropertyJmxNames(clusterName, mode), clusterName);
      }

      private String getServicePropertiesJmxName(String serviceName, @Nullable DualReadModeProvider.DualReadMode mode)
      {
        return String.format("%s%s-ServiceProperties", getServicePrefixForLBPropertyJmxNames(serviceName, mode), serviceName);
      }

      private String getLoadBalancerStrategyJmxName(String serviceName, String scheme, @Nullable DualReadModeProvider.DualReadMode mode)
      {
        return String.format("%s%s-%s-LoadBalancerStrategy", getServicePrefixForLBPropertyJmxNames(serviceName, mode), serviceName, scheme);
      }
    });
  }
@Test(dataProvider = "nonDualReadD2ClientJmxManagers")
  public void testSetSimpleLBStateListenerUpdateServiceProperties(String prefix, D2ClientJmxManager.DiscoverySourceType sourceType,
      Boolean isDualReadLB)
  {
    D2ClientJmxManagerFixture fixture = new D2ClientJmxManagerFixture();
    D2ClientJmxManager d2ClientJmxManager = fixture.getD2ClientJmxManager(prefix, sourceType, isDualReadLB);

    d2ClientJmxManager.setSimpleLoadBalancerState(fixture._simpleLoadBalancerState);
    fixture._simpleLoadBalancerStateListenerCaptor.getValue().onServicePropertiesUpdate(null);
    Mockito.verify(fixture._jmxManager, never()).registerServiceProperties(any(), any());
    fixture._simpleLoadBalancerStateListenerCaptor.getValue().onServicePropertiesUpdate(NO_PROPERTY_LB_STATE_ITEM);
    Mockito.verify(fixture._jmxManager, never()).registerServiceProperties(any(), any());

    fixture._simpleLoadBalancerStateListenerCaptor.getValue().onServicePropertiesUpdate(
        SERVICE_PROPERTIES_LOAD_BALANCER_STATE_ITEM);
    Assert.assertEquals(
        fixture._registerObjectNameCaptor.getValue(),
        "S_Foo-ServiceProperties"
    );
    Assert.assertEquals(
        fixture._servicePropertiesArgumentCaptor.getValue(), SERVICE_PROPERTIES_LOAD_BALANCER_STATE_ITEM
    );
  }