@Override
  public Distribution distribute(D2CanaryDistributionStrategy strategy)
  {
    switch (strategy.getStrategy()) {
      case TARGET_HOSTS:
        return distributeByTargetHosts(strategy);
      case TARGET_APPLICATIONS:
        return distributeByTargetApplications(strategy);
      case PERCENTAGE:
        return distributeByPercentage(strategy);
      case DISABLED:
        return Distribution.STABLE;
      default:
        _log.warn("Invalid distribution strategy type: " + strategy.getStrategy().name());
        return Distribution.STABLE;
    }
  }
@Test
  public void testNormalCasesForHostsStrategy()
  {
    TargetHostsStrategyProperties hostsProperties =
        new TargetHostsStrategyProperties().setTargetHosts(new StringArray(Arrays.asList("hostA", "hostB")));
    D2CanaryDistributionStrategy targetHostsStrategy =
        new D2CanaryDistributionStrategy().setStrategy(StrategyType.TARGET_HOSTS)
            .setTargetHostsStrategyProperties(hostsProperties);

    CanaryDistributionProviderImplFixture fixture = new CanaryDistributionProviderImplFixture();

    Assert.assertEquals(fixture.getSpiedImpl(null, "hostA").distribute(targetHostsStrategy), // in target list
        CanaryDistributionProvider.Distribution.CANARY, "Host in target list should return canary.");

    Assert.assertEquals(fixture.getSpiedImpl(null, "hostC").distribute(targetHostsStrategy), // NOT in target list
        CanaryDistributionProvider.Distribution.STABLE, "Host not in target list should return stable.");
  }